A PowerShell tool for checking Azure VM SKU availability across regions - find where your VMs can deploy.
Get-AzVMAvailability helps you identify which Azure regions have available capacity for your VM deployments. It scans multiple regions in parallel and provides detailed insights into SKU availability, zone restrictions, quota limits, pricing, and image compatibility.
-AZswitch (auto-enabled by-LifecycleRecommendations) — addsZones (Deployed)on SubMap / Resource Group Map (which zones your VMs run in today) andZones (Supported)on Lifecycle Summary / High Risk / Medium Risk (which zones the recommended replacement supports — OK, Limited, Restricted). No extra flag needed in lifecycle mode.- GOV / sovereign cloud fixes — Savings Plan columns now omitted automatically for sovereign tenants; Reserved Instance / Savings Plan / Spot retail rates are preserved when negotiated price sheet succeeds (previously RI/SP/Spot columns came back empty). Per-sub
Quota: need ...text stripped from the Lifecycle SummaryRisk Reasons(still surfaced on SubMap / RGMap). Cross-region ACU fallback for upgrade-path candidates.
- Smart default regions — defaults now auto-detect based on cloud environment (Gov, China) and local timezone (Americas, Europe, APAC, etc.) — no more commercial defaults when connected to sovereign clouds
- PowerShell module — install via
Install-Module AzVMAvailabilityfrom PSGallery, or import directly from the repo - Core interface unchanged — all 39 parameters, output formats, and interactive prompts are identical to v1.14.0; only the default region selection is smarter
- Thin wrapper —
Get-AzVMAvailability.ps1still works as a standalone entry point (imports the module and forwards parameters) - Private functions — 43 helper functions are now truly private; only
Get-AzVMAvailabilityis exported - CI/CD publishing — automated PSGallery + GitHub Release publishing on merge to main
- Lifecycle Recommendations — run
-LifecycleRecommendationsfor a fully autonomous scan: pulls live VM inventory via Azure Resource Graph, analyzes retirement risk, and provides up to 6 upgrade alternatives per SKU with pricing, powered by a curated upgrade-path knowledge base. Optionally use-LifecycleFileto load VMs from a CSV/JSON/XLSX instead of live scan -SubMap/-RGMap— new deployment mapping sheets in XLSX exports, grouping affected VMs by subscription or resource group with risk-level enrichment-Tagfilter — filter live VM inventory scans by Azure resource tags (key=value or key=*)-RateOptimization— opt-in Savings Plan and Reserved Instance pricing columns alongside PAYG
Full history: CHANGELOG.md
- Multi-Region Parallel Scanning - Scan 10+ regions in ~15 seconds using concurrent HttpClient-based REST calls
- SKU Filtering - Filter to specific SKUs with wildcard support (e.g.,
Standard_D*_v5) - Lifecycle Recommendations - Run fully autonomous with
-LifecycleRecommendations— no prompts, auto-enables pricing, Excel export, savings plan/reservation details, and quota. Without-LifecycleFile, pulls live VM inventory from Azure via Resource Graph. With-LifecycleFile, loads VMs from a CSV/JSON/XLSX file. Legacy positional form-LifecycleRecommendations .\my-vms.csvis also supported - Live Lifecycle Scan -
-LifecycleScanpulls VM inventory directly from Azure via Resource Graph with management group, resource group, and tag filters - Deployment Mapping -
-SubMap/-RGMapsheets group affected VMs by subscription or resource group with risk enrichment - Pricing Information - Show hourly/monthly pricing (retail or negotiated EA/MCA rates) with optional Savings Plan and Reserved Instance comparisons
- Spot VM Pricing - Include Spot pricing alongside on-demand rates
- Placement Scores - Show allocation likelihood (High/Medium/Low) for each SKU via Azure Spot Placement API
- Image Compatibility - Verify Gen1/Gen2 and x64/ARM64 requirements
- Zone Availability - Per-zone availability details
- Quota Tracking - Available vCPU quota per family
- Multi-Region Matrix - Color-coded comparison view
- Interactive Drill-Down - Explore specific families and SKUs
- Export Options - CSV and styled XLSX with conditional formatting
- JSON Output - Structured JSON for AI agent integration and automation pipelines
- Inventory Readiness - Validate capacity and quota for an entire VM BOM in one command
- Compatibility-Validated Recommendations - Alternatives are validated to meet or exceed the target SKU's NICs, accelerated networking, premium IO, disk interface, ephemeral OS disk, and Ultra SSD requirements. Data disks and IOPS are scored as soft dimensions
| Task | Azure Portal | This Script |
|---|---|---|
| Check 10 regions | ~5 minutes | ~15 seconds |
| Get quota + availability | Multiple blades | Single view |
| Compare pricing across regions | Separate calculator | Integrated |
| Filter to specific SKUs | Scroll through hundreds | Wildcard filtering |
| Check image compatibility | Manual research | Automated validation |
| Analyze VM retirement risk | Azure Advisor + manual | Single command |
| Export results | Manual copy/paste | One command |
- VM Lifecycle & Retirement Planning - Identify old-gen and retiring SKUs across your fleet and get validated upgrade paths
- Disaster Recovery Planning - Identify backup regions with capacity
- Multi-Region Deployments - Find regions where all required SKUs are available
- GPU/HPC Workloads - NC, ND, NV series are often constrained; find where they're available
- Inventory Readiness Validation - Verify capacity and quota for an entire VM BOM before deployment
- Image Compatibility - Verify SKUs support your Gen2 or ARM64 images before deployment
- Troubleshooting Deployments - Quickly identify why a deployment might be failing
- PowerShell 7.0+ (required)
- Azure PowerShell Modules:
Az.Accounts,Az.Compute,Az.Resources - Optional:
ImportExcelmodule for styled XLSX export - Optional:
Az.ResourceGraphmodule for-LifecycleRecommendationsand-LifecycleScanlive VM inventory
# Install from PSGallery (available after v2.0.0 release)
Install-Module AzVMAvailability -Repository PSGallery
# Or import directly from the repo
Import-Module .\AzVMAvailability
# Login and scan
Connect-AzAccount
Get-AzVMAvailability -Region "eastus" -NoPrompt# Interactive Login to Azure
Connect-AzAccount -Tenant YourTenantIdHere -subscription YourSubIdHere
# Interactive mode - prompts for all options
.\Get-AzVMAvailability.ps1
# Automated mode - uses current subscription
.\Get-AzVMAvailability.ps1 -NoPrompt -Region "eastus","westus2"
# With auto-export
.\Get-AzVMAvailability.ps1 -Region "eastus","eastus2" -AutoExport
# Inventory readiness check from CSV file
.\Get-AzVMAvailability.ps1 -InventoryFile .\examples\fleet-bom.csv -Region "eastus" -NoPrompt
# Lifecycle scan — pull live VM inventory from Azure and analyze retirement risk
# Runs fully autonomous: no prompts, auto-enables pricing, Excel export, and quota
.\Get-AzVMAvailability.ps1 -LifecycleRecommendations
# Lifecycle analysis — load VMs from a CSV/JSON/XLSX file instead of live scan
.\Get-AzVMAvailability.ps1 -LifecycleRecommendations -LifecycleFile .\my-vms.csv -Region "eastus"
# Lifecycle analysis — from Azure portal VM export (XLSX)
.\Get-AzVMAvailability.ps1 -LifecycleRecommendations -LifecycleFile .\AzureVirtualMachines.xlsx
# Live lifecycle scan with filters — management group, resource group, or tag scoping
.\Get-AzVMAvailability.ps1 -LifecycleScan -ManagementGroup "Corp" -Tag @{Environment='prod'} -NoPromptAs of v2.0.0, Get-AzVMAvailability is available as both a standalone script and a PowerShell module. Existing script users see no changes — the .ps1 file still works exactly as before.
Script (.\Get-AzVMAvailability.ps1) |
Module (Get-AzVMAvailability) |
|
|---|---|---|
| Install | git clone or download ZIP |
Install-Module AzVMAvailability |
| Run | .\Get-AzVMAvailability.ps1 -Region eastus |
Get-AzVMAvailability -Region eastus |
| Works from any directory | No — requires full path or cd to repo |
Yes — available globally after install |
| Update | git pull |
Update-Module AzVMAvailability |
| Tab completion & Get-Help | Requires dot-sourcing first | Works immediately |
| Use in automation scripts | . .\Get-AzVMAvailability.ps1 (dot-source) |
Import-Module AzVMAvailability |
| Parameters & output | Identical | Identical |
- Module users: Run
Update-Module AzVMAvailabilityperiodically, or check your installed version withGet-Module AzVMAvailability -ListAvailable. - Script users: Run
git pullto get the latest version. - Release notifications: Click Watch → Custom → Releases on the GitHub repo to be notified of new versions.
| Topic | Description |
|---|---|
| Parameters | Reference table for all 39 parameters, including names, types, and descriptions |
| Usage Examples | Common scanning patterns — GPU, pricing, export, multi-region |
| Inventory Planning | Validate capacity and quota for an entire VM BOM |
| Lifecycle Recommendations | Retirement risk analysis with upgrade alternatives |
| Region Presets | Pre-built region sets for US, Europe, Asia-Pacific, sovereign clouds |
| Image Compatibility | Gen1/Gen2 and x64/ARM64 image checking |
| Output & Pricing | Console output, pricing auto-detection, Excel export, status legend |
| Cloud Environments | Supported Azure clouds (Commercial, Government, China) |
| AI Agent Integration | Copilot skill for natural-language VM capacity queries |
| GitHub Codespaces | Run in a browser with zero local setup |
| Local Installation | Clone, install modules, and import |
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
See ROADMAP.md for planned features. Recently shipped:
- Azure Resource Graph integration — live VM inventory via
-LifecycleScan(v1.14.0) - PowerShell module —
Install-Module AzVMAvailabilityfrom PSGallery (v2.0.0)
Up next:
- HTML reports and trend tracking
This project is licensed under the MIT License - see LICENSE for details.
Zachary Luz — Personal project (not an official Microsoft product)
This tool queries only public Azure APIs (SKU availability, quota, retail pricing) against your own Azure subscriptions. It reads subscription metadata (such as subscription IDs/names, regions, quotas, and usage) and writes results locally (console output and CSV/XLSX exports); it does not transmit this data off your machine except as required to call Azure APIs.
- Issues & PRs: Welcome! Please do not include subscription IDs, tenant IDs, internal URLs, or any confidential information.
- Azure support: For Azure platform issues or outages, contact Azure Support — not this repository.
- Exported files: Review CSV/XLSX exports before sharing externally — they may contain subscription IDs, region information, quotas, and usage details for your environment.
The author is a Microsoft employee; however, this is a personal open-source project. It is not an official Microsoft product, nor is it endorsed, sponsored, or supported by Microsoft.
- No warranty: Provided "as-is" under the MIT License.
- No official support: For Azure platform issues, use Azure Support.
- No confidential information: This tool uses only publicly documented Azure APIs. Please do not share internal or confidential information in issues, pull requests, or discussions.
- Trademarks: "Microsoft" and "Azure" are trademarks of Microsoft Corporation. Their use here is for identification only and does not imply endorsement.
See CHANGELOG.md for version history.
If Windows warns that the script came from the internet, unblock it once:
Unblock-File .\Get-AzVMAvailability.ps1If you see an error like The property 'AzureEndpoints' cannot be found on this object, you are likely running an older script copy.
Select-String -Path .\Get-AzVMAvailability.ps1 -Pattern 'AzureEndpoints\s*=\s*\$null'If this command returns a match, the file you are running still contains the old code path and should be replaced with the current Get-AzVMAvailability.ps1 wrapper from this repo, or you should run the module directly with Import-Module .\AzVMAvailability.
If the command returns no output, that stale-copy marker is not present in this file. Confirm you are launching the expected script path and not another older copy from a different folder.
