| name | azure-vm-availability |
| description | Scan Azure regions for VM SKU restriction status, quota headroom, pricing, placement signals, and image compatibility using Get-AzVMAvailability. Reports deployment readiness signals, not live capacity guarantees. USE FOR: where can I deploy VMs, check VM SKU restrictions, GPU availability, find available regions, VM SKU restricted, capacity constrained, find alternative SKU, recommend replacement VM, compare regions for VMs, DR region planning, check zone availability, is this SKU available, scan regions. DO NOT USE FOR: general VM size recommendations without Azure login (use azure-compute), quota management via CLI (use azure-quotas), deploying VMs (use azure-prepare). |
| license | MIT |
| metadata | {"author":"Zachary Luz","version":"1.1.0"} |
Azure VM Availability - SKU Restriction and Quota Scanner
AUTHORITATIVE GUIDANCE — This skill teaches you when and how to invoke
the Get-AzVMAvailability.ps1 script via terminal for Azure VM SKU
restriction, quota, pricing, and placement-signal scanning. The script is the
routing layer.
Interpretation rule: Status values come from ARM Microsoft.Compute/skus
restriction metadata. OK means no ARM SKU restriction was returned for the
scanned scope; it is not a live physical capacity guarantee.
When to Use This Skill
Invoke this skill when the user wants to:
- Check VM SKU availability metadata across Azure regions
- Find which regions return no ARM SKU restrictions for a specific VM family or SKU
- Discover GPU/HPC SKU availability (NC, ND, NV series are often constrained)
- Find alternative SKUs when a target VM is constrained or restricted
- Plan disaster recovery by comparing SKU restriction status across region pairs
- Verify image compatibility (Gen1/Gen2, x64/ARM64) before deployment
- See pricing alongside availability (retail or negotiated EA/MCA/CSP)
- Export availability data to CSV/XLSX for reporting
- Troubleshoot why a VM deployment is failing (restricted, quota exceeded)
When NOT to Use This Skill
| Scenario | Use Instead |
|---|
| General VM size recommendation (no Azure login needed) | azure-compute |
Check/manage quota limits via az quota CLI | azure-quotas |
| Deploy VMs or infrastructure | azure-prepare → azure-validate → azure-deploy |
| Diagnose portal-vs-programmatic quota mismatch | azure-quota-subfamily-mismatch-diagnosis |
| Verify local script is up to date | azvmavailability-release-verification-workflow |
Prerequisites
Before running, verify these requirements. Stop and help the user fix any missing prerequisite.
1. Script Must Be On The Machine
# Check if the script exists in common locations
$paths = @(
"$env:USERPROFILE\Get-AzVMAvailability\Get-AzVMAvailability.ps1",
"$env:USERPROFILE\source\repos\Get-AzVMAvailability\Get-AzVMAvailability.ps1",
"$env:USERPROFILE\OneDrive - Microsoft\Get-AzVMAvailability\Get-AzVMAvailability.ps1"
)
$found = $paths | Where-Object { Test-Path $_ } | Select-Object -First 1
if ($found) { Write-Host "Found: $found" } else { Write-Host "NOT FOUND" }
If not found, tell the user:
git clone https://github.com/ZacharyLuz/Get-AzVMAvailability.git
cd Get-AzVMAvailability
2. PowerShell 7+ Required
$PSVersionTable.PSVersion # Must be 7.0+
If running in Windows PowerShell 5.1, prefix commands with pwsh -File.
3. Azure Modules & Login
Get-Module Az.Compute -ListAvailable # Must be installed
Get-AzContext # Must have active login
If not logged in: Connect-AzAccount
Decision Tree
User request
│
├─ "What VM should I use for X workload?"
│ └─ Use azure-compute skill (no login needed)
│
├─ "Check my quota limits"
│ └─ Use azure-quotas skill (az quota CLI)
│
├─ "Where can I deploy Standard_D4s_v5?"
│ └─ THIS SKILL → Scan mode
│
├─ "Is this GPU SKU unrestricted in eastus?"
│ └─ THIS SKILL → Scan mode with FamilyFilter
│
├─ "E64pds_v6 is constrained, what else can I use?"
│ └─ THIS SKILL → Recommend mode
│
├─ "Can my VM fleet deploy in eastus?" / "Check this BOM"
│ └─ THIS SKILL → Fleet mode (-FleetFile or -Fleet)
│
├─ "Compare eastus vs westus2 for D-series"
│ └─ THIS SKILL → Scan mode, multi-region
│
└─ "Check if my image works with this SKU"
└─ THIS SKILL → Scan mode with ImageURN
Core Workflows
Workflow 1: Region Restriction Scan
Scenario: Check which regions return no ARM SKU restrictions for specific VM SKUs or families.
# Basic scan — specific SKU across regions
.\Get-AzVMAvailability.ps1 -NoPrompt -Region "eastus","westus2","centralus" -SkuFilter "Standard_D4s_v5" -JsonOutput
# Scan a VM family across US regions
.\Get-AzVMAvailability.ps1 -NoPrompt -RegionPreset USMajor -FamilyFilter "D","E" -JsonOutput
# GPU availability scan
.\Get-AzVMAvailability.ps1 -NoPrompt -Region "eastus","southcentralus","westus2" -FamilyFilter "NC","ND","NV" -JsonOutput
Always use -NoPrompt -JsonOutput when running from Copilot to get structured output.
Workflow 2: Find Alternative SKUs (Recommend Mode)
Scenario: A target SKU is constrained or restricted — find similar available alternatives.
# Find alternatives for a constrained SKU
.\Get-AzVMAvailability.ps1 -NoPrompt -Recommend "Standard_E64pds_v6" -Region "eastus","westus2","centralus" -JsonOutput
# Show more results with lower threshold
.\Get-AzVMAvailability.ps1 -NoPrompt -Recommend "Standard_NC24ads_A100_v4" -RegionPreset USMajor -TopN 10 -MinScore 0 -JsonOutput
# Filter by minimum specs
.\Get-AzVMAvailability.ps1 -NoPrompt -Recommend "Standard_D8s_v5" -Region "eastus" -MinvCPU 8 -MinMemoryGB 32 -JsonOutput
Workflow 3: Scan with Pricing
# Auto-detects negotiated EA/MCA/CSP rates, falls back to retail
.\Get-AzVMAvailability.ps1 -NoPrompt -Region "eastus","westus2" -FamilyFilter "D" -ShowPricing -JsonOutput
Workflow 4: Image Compatibility Check
# Verify ARM64 image compatibility
.\Get-AzVMAvailability.ps1 -NoPrompt -Region "eastus" -SkuFilter "Standard_D*ps*" -ImageURN "Canonical:0001-com-ubuntu-server-jammy:22_04-lts-arm64:latest" -JsonOutput
# Check Gen2 Windows image
.\Get-AzVMAvailability.ps1 -NoPrompt -Region "eastus","westus2" -ImageURN "MicrosoftWindowsServer:WindowsServer:2022-datacenter-g2:latest" -JsonOutput
Workflow 5: DR Region Planning
# Azure Site Recovery pair
.\Get-AzVMAvailability.ps1 -NoPrompt -RegionPreset ASR-EastWest -FamilyFilter "D","E" -ShowPricing -JsonOutput
# Custom DR pair
.\Get-AzVMAvailability.ps1 -NoPrompt -Region "eastus","westus2" -ShowPricing -JsonOutput
Workflow 6: Placement Scores and Spot Pricing
Scenario: See allocation likelihood and spot pricing alongside recommendations.
# Recommend with placement scores (shows High/Medium/Low allocation likelihood)
.\Get-AzVMAvailability.ps1 -NoPrompt -Recommend "Standard_D4s_v5" -Region "eastus","westus2" -ShowPlacement -JsonOutput
# Full enrichment: pricing + placement + spot pricing
.\Get-AzVMAvailability.ps1 -NoPrompt -Recommend "Standard_D4s_v5" -Region "eastus" -ShowPricing -ShowPlacement -ShowSpot -JsonOutput
# Placement scores in filtered scan mode (max 5 SKUs)
.\Get-AzVMAvailability.ps1 -NoPrompt -Region "eastus" -SkuFilter "Standard_D4s_v5" -ShowPlacement -JsonOutput
Notes:
-ShowPlacement requires "Compute Recommendations Role" RBAC -- fails gracefully with a warning if missing
-ShowSpot only adds value when -ShowPricing is also set (spot dollar values need pricing context)
- Placement API accepts max 5 SKUs x 8 regions per call -- larger sets are truncated with a verbose warning
Workflow 7: Fleet Readiness (BOM Validation)
Scenario: Validate an entire VM fleet (bill of materials) against ARM SKU restriction status and quota for every SKU in the BOM simultaneously.
# Step 1: Generate template files (no Azure login needed)
.\Get-AzVMAvailability.ps1 -GenerateFleetTemplate
# → Creates fleet-template.csv and fleet-template.json in current directory
# → Edit with your actual SKUs and quantities
# Step 2: Run the scan with your fleet file
.\Get-AzVMAvailability.ps1 -FleetFile .\fleet-template.csv -Region "eastus" -NoPrompt
# Alternative: CSV file (export from Excel, paste from table)
.\Get-AzVMAvailability.ps1 -FleetFile .\fleet.csv -Region "eastus" -NoPrompt
# Alternative: Inline hashtable (for scripting/automation)
.\Get-AzVMAvailability.ps1 -Fleet @{'Standard_D2s_v5'=17; 'Standard_D4s_v5'=4; 'Standard_D8s_v5'=5} -Region "eastus" -NoPrompt
# Alternative: JSON file input (for automation pipelines)
.\Get-AzVMAvailability.ps1 -FleetFile .\fleet.json -Region "eastus" -NoPrompt -JsonOutput
CSV file format (save as fleet.csv):
SKU,Qty
Standard_D2s_v5,17
Standard_D4s_v5,4
Standard_D8s_v5,5
Standard_D16ds_v5,1
Standard_D16ls_v6,1
JSON file format (save as fleet.json):
[
{ "SKU": "Standard_D2s_v5", "Qty": 17 },
{ "SKU": "Standard_D4s_v5", "Qty": 4 },
{ "SKU": "Standard_D8s_v5", "Qty": 5 },
{ "SKU": "Standard_D16ds_v5", "Qty": 1 },
{ "SKU": "Standard_D16ls_v6", "Qty": 1 }
]
Column name flexibility: The parser accepts SKU, Name, or VmSize for the SKU column, and Qty, Quantity, or Count for the quantity column. Duplicate SKU rows are summed automatically.
Output: Color-coded per-SKU restriction-status table + per-family quota pass/fail (Used/Available/Limit) + overall PASS/FAIL verdict.
When to route here vs Recommend mode:
- User has a specific BOM (list of SKUs + quantities) → Fleet mode
- User has ONE constrained SKU and wants alternatives → Recommend mode
Workflow 8: Export for Reporting
# Auto-export to XLSX (styled, color-coded)
.\Get-AzVMAvailability.ps1 -NoPrompt -RegionPreset USMajor -AutoExport -OutputFormat XLSX
# Export to specific path
.\Get-AzVMAvailability.ps1 -NoPrompt -Region "eastus","westus2" -ExportPath "C:\Reports" -AutoExport
Parameter Quick Reference
| Parameter | Type | Purpose |
|---|
-Region | String[] | Azure region codes (e.g., "eastus","westus2") |
-RegionPreset | String | Predefined set: USEastWest, USCentral, USMajor, Europe, AsiaPacific, Global, USGov, China, ASR-EastWest, ASR-CentralUS |
-FamilyFilter | String[] | Filter to families: D, E, F, M, NC, ND, NV, etc. |
-SkuFilter | String[] | Specific SKUs with wildcards: "Standard_D*_v5" |
-Recommend | String | Target SKU for alternative finding |
-ShowPricing | Switch | Include hourly/monthly pricing |
-ImageURN | String | Check image compatibility (Publisher:Offer:Sku:Version) |
-NoPrompt | Switch | Always use from Copilot — skip interactive prompts |
-JsonOutput | Switch | Always use from Copilot — structured JSON output |
-AutoExport | Switch | Export without prompting |
-OutputFormat | String | Auto, CSV, or XLSX |
-TopN | Int | Recommendations to return (default 5, max 25) |
-MinScore | Int | Min similarity score 0-100 (default 50, use 0 for all) |
-MinvCPU | Int | Min vCPU filter for recommendations |
-MinMemoryGB | Int | Min memory filter for recommendations |
-ShowPlacement | Switch | Show allocation likelihood scores (High/Medium/Low) per SKU |
-ShowSpot | Switch | Include Spot VM pricing (requires -ShowPricing) |
-DesiredCount | Int | VM count for placement score API (default 1) |
-AllowMixedArch | Switch | Include x64+ARM64 mix in recommendations |
Region Presets
| Preset | Regions | Notes |
|---|
| USEastWest | eastus, eastus2, westus, westus2 | US coastal |
| USCentral | centralus, northcentralus, southcentralus, westcentralus | US central |
| USMajor | eastus, eastus2, centralus, westus, westus2 | Top 5 US |
| Europe | westeurope, northeurope, uksouth, francecentral, germanywestcentral | EU |
| AsiaPacific | eastasia, southeastasia, japaneast, australiaeast, koreacentral | APAC |
| Global | eastus, westeurope, southeastasia, australiaeast, brazilsouth | Worldwide |
| USGov | usgovvirginia, usgovtexas, usgovarizona | Auto-sets AzureUSGovernment |
| China | chinaeast, chinanorth, chinaeast2, chinanorth2 | Auto-sets AzureChinaCloud |
| ASR-EastWest | eastus, westus2 | DR pair |
| ASR-CentralUS | centralus, eastus2 | DR pair |
Max 5 regions per scan for performance.
JSON Output Schema
Scan Mode
{
"schemaVersion": "1.0",
"mode": "scan",
"generatedAt": "ISO8601",
"subscriptions": ["sub-id"],
"regions": ["eastus", "westus2"],
"summary": {
"familyCount": 20,
"detailRowCount": 150,
"regionErrorCount": 0
},
"families": [
{
"family": "D",
"totalSkusDiscovered": 25,
"availableRegionCount": 3,
"constrainedRegionCount": 0,
"largestSku": "Standard_D96s_v5"
}
],
"regionErrors": []
}
Recommend Mode
{
"schemaVersion": "1.0",
"mode": "recommend",
"generatedAt": "ISO8601",
"minScore": 50,
"topN": 5,
"pricingEnabled": false,
"placementEnabled": false,
"spotPricingEnabled": false,
"target": {
"Name": "Standard_E64pds_v6",
"vCPU": 64,
"MemoryGB": 512,
"Family": "E",
"Generation": "V1,V2",
"Architecture": "x64",
"PremiumIO": true,
"Processor": "ARM",
"DiskCode": "NV+T"
},
"targetAvailability": [
{ "Region": "eastus", "Status": "LIMITED", "ZonesOK": 0 }
],
"recommendations": [
{
"rank": 1,
"sku": "Standard_E64ds_v5",
"region": "eastus",
"vCPU": 64,
"memGiB": 512,
"family": "E",
"score": 93,
"restrictionStatus": "OK",
"allocScore": "N/A",
"zonesOK": 3,
"priceHr": null,
"priceMo": null,
"spotPriceHr": null,
"spotPriceMo": null
}
],
"warnings": ["Mixed CPU vendors (Intel, ARM)"],
"belowMinSpec": []
}
Note: The examples above show key fields for brevity. In actual output,
each recommendations object also includes purpose, gen, arch, cpu,
disk, tempDiskGB, and accelNet. The target object also includes
TempDiskGB and AccelNet. Treat the schema as additive -- new fields may
appear in future versions, but existing fields will not be removed without
a schemaVersion change.
SKU Restriction Status Meanings
capacity remains in JSON and table fields for schema compatibility. Interpret it as ARM SKU restriction status, not live allocation capacity.
| Status | Meaning | Action |
|---|
| OK | No ARM SKU restriction returned | Validate quota, placement, and deployment dependencies |
| LIMITED | Subscription/SKU access restriction | Request access or quota review if needed |
| ZONE-LIMITED | Some zones returned ARM restriction records | Try another zone and verify placement/deployment |
| PARTIAL | Mixed zone restriction state | Treat zone redundancy as limited |
| RESTRICTED | Blocking ARM restriction returned | Pick different region or SKU |
Interpreting Results
When presenting results to the user:
- Scan mode: Summarize which families/SKUs returned no ARM restrictions (OK) vs constrained, highlight best regions
- Recommend mode: Present the top alternatives ranked by similarity score, note any fleet warnings (mixed CPU vendors, mixed disk types)
- Always mention: quota availability, zone coverage, pricing if shown, and that OK is not a live capacity guarantee
- If no OK results: Suggest expanding regions, lowering MinScore, or trying different families
Troubleshooting
| Issue | Solution |
|---|
| Script not found | git clone https://github.com/ZacharyLuz/Get-AzVMAvailability.git |
| PowerShell 5.1 error | Use pwsh -File .\Get-AzVMAvailability.ps1 |
| No Azure context | Run Connect-AzAccount first |
AzureEndpoints error | Script is stale — pull latest from repo |
| Region validation fails | Add -SkipRegionValidation as last resort |
Quota shows ? | Quota API didn't return data for that family |