/engsys-azure:azure-deployment-preflightfrom engsys-azure
Preflight validation for Azure infrastructure deployments (Bicep/ARM). Run before any az deployment / azd up. Validates templates (bicep build, az deployment group validate / what-if), cleans up stale failed ARM deployments that block re-deploy, catches globally-unique naming conflicts (Key Vault/ACR/etc.), and checks SKU/tier and service-limit restrictions. Carries the hard-won Bicep lessons (PgBouncer Burstable limit, alert module location, KQL interpolation, ACR SKU). Activate when the active cloud is Azure and the user mentions deploying, validating Bicep, what-if, preview, az deployment, azd provision, or deploy failures.
Ships in engsys-azure. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Validate Bicep/ARM deployments locally and clear blocking state before you deploy,
so CI doesn't discover what you could have caught. Supports both az CLI and azd
workflows. Continue through all steps even if one fails — capture every issue, then fix
them in a batch.
Discipline: batch your fixes. Each push triggers a ~15-30 min CI run. Read the entire failing module, reason about all potential issues, fix them all, push once. One CI run per problem cluster, not one per error message.
az deployment, azd up, azd provision).azure.yaml at root → use the azd workflow. Bicep usually under
infra/. Otherwise use the az CLI workflow..bicep files (common: infra/, infrastructure/, deploy/, root) and
the matching parameter file per template: <name>.bicepparam (preferred) or
<name>.parameters.json.targetScope in the template
(resourceGroup default / subscription / managementGroup / tenant) — it picks
the validate/what-if command in Step 3.az account show (subscription), resource group, location. Prompt
for any missing required value before proceeding.bicep build <bicep-file> --stdout # or: az bicep build --file <bicep-file>
bicep build/az bicep buildonly checks syntax. It will not catch metric names, KQL scope, secret-ref mismatches, invalid property combinations, or naming collisions. Treat it as the first gate, not the gate.
If the Bicep CLI is missing, note it and continue — Azure validates syntax during validate/what-if anyway.
azd provision --preview # or --environment <env>
az deployment ... validate then what-ifvalidate catches deployment-time errors (property combos, secret refs, quota where
checkable) that bicep build misses. Pass dummy values for required secure params so
validation can run:
cd infrastructure
az deployment group validate \
--resource-group <rg-name> \
--template-file main.bicep \
--parameters environments/<env>.bicepparam \
--parameters postgresAdminPassword="dummy" \
--parameters postgresAdminUsername="dummy"
If it fails locally, fix it locally. Do not push and let CI discover it.
Then preview changes with what-if (command by scope):
| targetScope | what-if command |
|---|---|
resourceGroup (default) | az deployment group what-if |
subscription | az deployment sub what-if --location <loc> |
managementGroup | az deployment mg what-if --management-group-id <id> --location <loc> |
tenant | az deployment tenant what-if --location <loc> |
az deployment group what-if \
--resource-group <rg-name> \
--template-file main.bicep \
--parameters environments/<env>.bicepparam \
--validation-level Provider
Fallback: if --validation-level Provider fails on RBAC, retry with
ProviderNoRbac and note in the report that the user may lack full deploy permissions.
What-if change symbols: + create · - delete · ~ modify · = no change · *
ignored · ! deploy (unknown). Flag any delete or replacement of a stateful
resource (PostgreSQL, Key Vault, storage).
ARM tracks deployment records by name. A failed sub-deployment (e.g.
<proj>-dev-alerts) blocks a new run with DeploymentActive even while it sits in
Failed. Clean up before each new attempt:
az deployment group list --resource-group <rg-name> \
--query "[?properties.provisioningState=='Failed'].name" -o tsv \
| grep -v "Failure-Anomalies" \
| xargs -I{} az deployment group delete --name {} --resource-group <rg-name> --no-wait
Several Azure resource types have globally-unique names, and names from a prior / deleted deployment are either reserved or soft-deleted (Key Vault purge protection keeps the name reserved). Parameterize the name and override on conflict:
| Resource | Typical default (gets taken) | Override pattern |
|---|---|---|
| Key Vault | <proj>-<env>-kv | <proj>-<env>-kv-<suffix> |
| Storage account | <proj><env>sa (3-24, lowercase alnum) | append short unique suffix |
| ACR | <proj><env>acr | append short unique suffix |
| Redis / Service Bus / Front Door / App | <proj>-<env>-<x> | ...-<suffix> |
Pattern: add param keyVaultName / param <x>Name to main.bicep and set the
override in environments/*.bicepparam — don't hard-code the bare default. If a script
(e.g. a Key Vault seeder) defaults the name internally, pass the override explicitly
and make every workflow step that references it use the same resolved name.
These were discovered the expensive way — don't rediscover them.
Basic may be unavailable on some subscriptions (e.g. Microsoft for
Startups). Standard works but retentionPolicy requires Premium — remove it
from dev/staging. If a failed deploy left a broken ACR, create it manually then let
Bicep treat it as no-change.Standard_B* (Burstable) cannot run
PgBouncer (needs GeneralPurpose+). Guard it:
resource pgBouncer ... = if (currentSku.tier != 'Burstable') { ... }.Microsoft.Insights/metricAlerts → location: 'global' ✅Microsoft.Insights/scheduledQueryRules → location: 'global' ❌; use the real
region (e.g. eastus2).scheduledQueryRules must scope to the Log Analytics workspace ID, not the App
Insights ID — the AppRequests table lives in the workspace.''' verbatim strings do not interpolate ${vars}
— build the query with string-concatenation variables instead.active_connections, not
connection_percent (that's Azure SQL).If CI auto-deploys on push to a branch, don't fire a manual deploy on top — the auto-run wins and yours sits queued (the user has to cancel it).
gh run list --workflow="<deploy workflow>" --limit 3
If a run is queued/in_progress, wait.
Summarize: validation + what-if results (creates / modifies / deletes /
replacements), stale deployments cleaned, naming overrides applied, SKU/tier issues, and
whether it's safe to deploy. Note any ProviderNoRbac fallback (permission gap).
Keep going on errors — capture every issue in the report.
| Error | Action |
|---|---|
| Not logged in / token expired | Note it; suggest az login --tenant <tenant-id> / azd auth login |
| Wrong subscription | az account set --subscription <id>, re-run Step 1 |
| Permission denied on what-if | Retry with ProviderNoRbac; note the permission gap |
| Bicep syntax error | Record all errors (file:line), continue with other files |
| Tool not installed | Note it; skip that step |
| Resource group not found | Note it; confirm the name/env before suggesting creation |
az CLI 2.76+ (for --validation-level), azd (azd projects), bicep CLI, gh (if
CI-driven). Verify auth: az account show / azd auth login. For deep Azure service
docs, use the microsoft-docs skill (Microsoft Learn MCP).
What SKILL.md sets; muted values are Claude Code's defaults
4 skills in this plugin
/azure-resource-visualizerAnalyze Azure resource groups and generate detailed Mermaid architecture diagrams showing the relationships between individual resources. Use this skill when the user asks for a diagram of their Azure resources or help in understanding how the resources relate to each other./cloud-architecture-azureAzure service-level architecture knowledge — compute (Container Apps/AKS/Functions), data (PostgreSQL Flexible Server/Cosmos DB), messaging (Service Bus/Event Grid/Event Hubs), edge (Front Door/API Management), identity (Entra), storage + secrets (Blob/Key Vault/ACR), and Azure OpenAI. Cost models, service limits, failure modes, and cold-start gotchas. Activate when the active cloud is Azure and the work involves designing, scaling, costing, or diagnosing Azure architecture (Container Apps cold starts, PostgreSQL connection limits, Service Bus quotas, Front Door, NAT egress).Other plugins' skills for the same job
/microsoft-docsQuery official Microsoft documentation (Azure service limits, SKU/tier behavior, CLI/API reference, Bicep resource schemas, .NET, Entra, Microsoft Graph) via the Microsoft Learn MCP server, with Context7 for Microsoft-ecosystem docs that live outside learn.microsoft.com (VS Code, GitHub, Aspire). Use whenever an Azure answer depends on a quota, SKU capability, API version, or property name — verify against docs instead of answering from memory.npx claudepluginhub eric-sabe/engsys --plugin engsys-azure