azure/azure-resource-availability
Query live Azure APIs to validate resource availability before template generation or deployment. Checks VM SKU restrictions, Kubernetes/runtime version support, API version compatibility, and subscription quota. Use during requirements gathering and preflight to catch deployment failures early.
npx skills add https://github.com/Azure/git-ape --skill azure-resource-availability
Validate that Azure resources, SKUs, service versions, and API versions are available in the target subscription and region before generating templates or deploying.
Extract the resource list from one of these sources (in priority order):
template.json for resource types, API versions, SKUs, and service versionsrequirements.json for requested resourcesFor each resource, extract:
Microsoft.ContainerService/managedClusters)For any resource that uses a VM SKU (AKS node pools, App Service Plans, VMs):
# Check if the SKU is available and unrestricted in the target region
az vm list-skus \
--location {region} \
--resource-type virtualMachines \
--size {sku_name} \
--output json 2>&1 | \
jq '[.[] | select(.restrictions | length == 0)] | length'
Interpret results:
If unavailable, find alternatives:
# Find similar unrestricted SKUs in the same family
# Example: if Standard_B2s is restricted, find other 2-vCPU options
az vm list-skus \
--location {region} \
--resource-type virtualMachines \
--output json 2>&1 | \
jq -r '[.[] | select((.restrictions | length == 0) and (.capabilities[] | select(.name == "vCPUs" and .value == "2"))) | .name] | unique | .[:5] | .[]'
# Get supported non-preview Kubernetes versions
az aks get-versions \
--location {region} \
--output json 2>&1 | \
jq -r '[.values[] | select(.isPreview != true)] | sort_by(.version) | .[].version'
Check: Is the requested version in the list?
# Linux runtimes
az functionapp list-runtimes --os-type linux --output json 2>&1 | \
jq -r '.[] | "\(.runtime): \(.version)"'
# Web App runtimes
az webapp list-runtimes --os-type linux --output json 2>&1
Check: Is the requested runtime + version available?
# Check if Container Apps is available in the region
az provider show \
--namespace Microsoft.App \
--query "resourceTypes[?resourceType=='containerApps'].locations" \
--output json 2>&1
For each resource type in the template, verify the API version is valid:
# Get available API versions for a resource type
az provider show \
--namespace {namespace} \
--query "resourceTypes[?resourceType=='{resourceType}'].apiVersions" \
--output json 2>&1
Example: For Microsoft.ContainerService/managedClusters:
az provider show \
--namespace Microsoft.ContainerService \
--query "resourceTypes[?resourceType=='managedClusters'].apiVersions" \
--output json 2>&1
Validation rules:
Recommend the latest stable API version:
# Get the latest non-preview API version
az provider show \
--namespace {namespace} \
--query "resourceTypes[?resourceType=='{resourceType}'].apiVersions" \
--output json 2>&1 | \
jq -r '.[][] | select(test("preview") | not)' | head -1
For compute resources, verify the subscription has available quota:
# Check vCPU quota usage in the target region
az vm list-usage \
--location {region} \
--output json 2>&1 | \
jq '.[] | select(.name.value | test("cores|vCPU"; "i")) | {name: .name.localizedValue, current: .currentValue, limit: .limit, available: (.limit - .currentValue)}'
Check: Will the deployment exceed quota limits?
# Verify the resource provider is registered in the subscription
az provider show \
--namespace {namespace} \
--query "registrationState" \
--output tsv 2>&1
If not registered: Flag as blocking — the deployment will fail. Include the registration command:
az provider register --namespace {namespace}
Produce a structured report with pass/fail/warning for each check.
Save to: .azure/deployments/{deployment-id}/availability-report.md (if deployment context exists)
# Resource Availability Report
**Region:** {region}
**Subscription:** {subscription-name} (`{subscription-id}`)
**Checked:** {ISO 8601 timestamp}
## Summary
| Check | Status | Details |
|-------|--------|---------|
| VM SKU: {sku} in {region} | ✅ Available / ❌ Restricted | {details} |
| K8s Version: {version} | ✅ Supported / ❌ Unsupported | {alternatives} |
| API Version: {api-version} | ✅ Valid / ⚠️ Outdated / ❌ Invalid | Latest stable: {latest} |
| Quota: vCPUs | ✅ Sufficient / ⚠️ Low / ❌ Exceeded | {current}/{limit} |
| Provider: {namespace} | ✅ Registered / ❌ Not registered | {command} |
## Availability Gate
**🟢 PASSED** — All checks passed. Safe to proceed with template generation/deployment.
**🟡 WARNINGS** — Non-blocking issues found. Review before proceeding.
**🔴 BLOCKED** — Blocking issues found. Must resolve before proceeding.
## Blocking Issues
{List of issues that prevent deployment}
## Warnings
{List of non-blocking issues}
## Recommendations
{Suggested alternatives for any failed checks}
Return the report to the calling agent/skill with:
PASSED, WARNINGS, or BLOCKEDJSON output (for programmatic consumption by other agents):
{
"gate": "PASSED|WARNINGS|BLOCKED",
"region": "{region}",
"timestamp": "{ISO 8601}",
"checks": [
{
"type": "vm-sku",
"resource": "{resource-name}",
"requested": "{sku}",
"status": "available|restricted|unavailable",
"alternatives": ["{alt1}", "{alt2}"]
},
{
"type": "service-version",
"resource": "{resource-name}",
"requested": "{version}",
"status": "supported|lts-only|preview-only|unsupported",
"supported": ["{v1}", "{v2}", "{v3}"]
},
{
"type": "api-version",
"resource": "{resource-type}",
"requested": "{api-version}",
"status": "valid|outdated|invalid",
"latestStable": "{latest}",
"available": ["{v1}", "{v2}"]
},
{
"type": "quota",
"metric": "vCPUs",
"required": 2,
"available": 48,
"limit": 50,
"status": "sufficient|low|exceeded"
},
{
"type": "provider-registration",
"namespace": "{namespace}",
"status": "registered|not-registered"
}
]
}
| Error | Action |
|-------|--------|
| Not logged in to Azure | Note in report; in interactive mode suggest az login; in headless mode fail |
| Region not found | Report as blocking; suggest default regions (East US, West Europe) |
| Provider namespace unknown | Report as warning; may be a typo in the resource type |
| Command timeout | Retry once; if still fails, report as "unable to verify" with ❓ |
| Empty results | Treat as "unavailable" — the SKU/version likely doesn't exist |
User provides region + resource type + SKU/version
→ /azure-resource-availability checks all three
→ If BLOCKED: present alternatives before finalizing requirements
→ If PASSED: proceed to template generation
Before selecting API version for a resource type
→ /azure-resource-availability checks latest stable API version
→ Generator uses the returned version instead of hardcoding
After template is generated, before what-if
→ /azure-resource-availability parses template for all resources
→ Validates SKUs, versions, API versions, quota
→ If BLOCKED: fail preflight with actionable report
→ If PASSED: proceed to what-if analysis
Before deploying a template (especially if generated days ago)
→ /azure-resource-availability re-checks all versions
→ If any version has been deprecated since generation: warn
Take azure/azure-resource-availability from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.