microsoftlearning/trainer-demo-deploy/az-azure-deploy
Claude Code and agent skill by microsoftlearning/trainer-demo-deploy
- community
Checking that the SKILL.md file is still in the repository.
Deployment patterns, azd usage, rollback procedures, and post-deployment validation for Azure infrastructure projects.
Install
npx vskill@latest install microsoftlearning/trainer-demo-deploy/az-azure-deploySKILL.md
The same SKILL.md was published earlier as microsoftlearning/trainer-demo-deploy/az-azure-deploy.
Azure Deploy Skill
Deployment patterns and procedures for Azure infrastructure provisioned via Bicep templates and the Azure Developer CLI (azd). Covers the full deployment lifecycle: pre-flight checks, execution strategies, post-deployment validation, rollback, and cleanup.
[!CAUTION]MANDATORY DEPLOYMENT POLICY1. Always attempt deployment: The Deploy agent MUST always attemptazd up.Tooling blockers (missing CLI, extension errors, auth issues) must be resolvedor escalated to the user — never used as a reason to autonomously skip deployment.2. User decides on failure: If deployment fails for any reason, present thefull error to the user and ask for their decision. Never autonomously generatea "dry-run only" or "blocked" summary and move on.3. Escalate, don’t absorb: If a pre-deployment gate fails and cannot beauto-fixed, ask the user. Do not silently document the failure and skip ahead.
1. Deployment Strategy Selection
Choose the deployment method based on available project artifacts:
| Method | When to Use | Prerequisites | |
|---|---|---|---|
| `azd up` (preferred) | azure.yaml exists in generated-scenarios/{project}/ | Azure Developer CLI installed, az login completed |
Decision Tree
2. Azure Developer CLI (azd) Patterns
First-Time Setup
azd up — Full Deployment
azd up provisions infrastructure AND deploys application code in one step:
azd provision — Infrastructure Only
When you only need to deploy Bicep templates without application code:
azd deploy — Application Only
When infrastructure exists and you need to push application code:
azure.yaml Structure
The azure.yaml file must be in generated-scenarios/{project}/ root:
[!IMPORTANT]Theinfra.pathmust point to the directory containingmain.bicep.For this project, that's./infra(relative togenerated-scenarios/{project}/).
azd Environment Variables
| Variable | Purpose | Example | |
|---|---|---|---|
AZURE_LOCATION | Default Azure region | eastus2 | |
AZURE_SUBSCRIPTION_ID | Target subscription | xxxxxxxx-xxxx-... | |
AZURE_ENV_NAME | Environment name | dev | |
AZURE_RESOURCE_GROUP | Target resource group | rg-funcsbweb-dev |
Set via:
3. What-If Analysis
Interpreting What-If Results
| Change Type | Symbol | Meaning | Action | |
|---|---|---|---|---|
| Create | + (green) | New resource will be created | Review for expected resources | |
| Delete | - (red) | Resource will be removed | Verify this is intentional | |
| Modify | ~ (purple) | Existing resource will be updated | Check which properties change | |
| No Change | = (gray) | Resource exists, no updates needed | Expected for idempotent runs | |
| Deploy | ! (yellow) | Resource type doesn't support what-if | Manual verification needed |
What-If Best Practices
- Always run what-if before the first deployment to a new environment
- Compare resource counts against the implementation plan
- Flag any unexpected DELETE operations — these may indicate naming changes
- Resources showing
Deploy(unsupported) need manual validation post-deployment
4. Post-Deployment Validation
Resource Existence Check
Provisioning State Check
All resources should show Succeeded. Any Failed or Creating states require investigation.
Service-Specific Health Checks
| Service | Command | Expected | |
|---|---|---|---|
| App Service | az webapp show --name {n} --resource-group {rg} --query "state" -o tsv | Running | |
| Function App | az functionapp show --name {n} --resource-group {rg} --query "state" -o tsv | Running | |
| Service Bus | az servicebus namespace show --name {n} --resource-group {rg} --query "provisioningState" -o tsv | Succeeded | |
| Key Vault | az keyvault show --name {n} --query "properties.provisioningState" -o tsv | Succeeded | |
| Storage | az storage account show --name {n} --resource-group {rg} --query "provisioningState" -o tsv | Succeeded | |
| SQL Server | az sql server show --name {n} --resource-group {rg} --query "state" -o tsv | Ready | |
| Cosmos DB | az cosmosdb show --name {n} --resource-group {rg} --query "provisioningState" -o tsv | Succeeded | |
| Container App | az containerapp show --name {n} --resource-group {rg} --query "properties.provisioningState" -o tsv | Succeeded | |
| Container Env | az containerapp env show --name {n} --resource-group {rg} --query "properties.provisioningState" -o tsv | Succeeded | |
| Log Analytics | az monitor log-analytics workspace show --workspace-name {n} --resource-group {rg} --query "provisioningState" -o tsv | Succeeded |
Deployment Outputs
5. Rollback Procedures
Full Rollback (Delete Everything)
Partial Rollback (Specific Resources)
Rollback Decision Tree
[!WARNING]Key Vault with purge protection enabled cannot be purged for 7-90 days(depending onsoftDeleteRetentionInDays). Plan Key Vault names carefullyto avoid naming collisions during re-deployments.
6. Common Deployment Errors
[!IMPORTANT]For every error in this table, the Deploy agent must **present the errorto the user and ask how to proceed** if auto-remediation fails.Never silently skip deployment or generate a dry-run summary.
| Error | Cause | Auto-Fix Attempt | If Auto-Fix Fails | |
|---|---|---|---|---|
AuthorizationFailed | Insufficient RBAC permissions | Suggest Contributor role assignment | Ask the user | |
InvalidTemplateDeployment | Bicep template has errors | Run bicep build to surface details | Ask the user | |
QuotaExceeded | SKU or region quota limit reached | Suggest alternative SKU or region | Ask the user | |
ResourceGroupNotFound | RG doesn't exist for RG-scoped deploy | Create with az group create | Ask the user | |
DeploymentFailed (nested) | A module within the template failed | Check az deployment operation group list | Ask the user | |
NameNotAvailable | Globally unique name already taken | Verify uniqueSuffix is applied correctly | Ask the user | |
ResourceProviderNotRegistered | Service not enabled in subscription | az provider register --namespace {ns} | Ask the user | |
MissingSubscriptionRegistration | Same as above | az provider register --namespace {ns} | Ask the user | |
LinkedAuthorizationFailed | Cross-scope role assignment failed | Verify managed identity exists before assigning roles | Ask the user | |
Conflict | Resource state doesn't allow the operation | Wait and retry | Ask the user | |
| Azure CLI broken/extension error | CLI extension permission or corruption | Try removing extension or running repair | Ask the user | |
| Bicep CLI missing | Bicep not installed | Try az bicep install | Ask the user to install manually |
Detailed Error Investigation
7. Cleanup Patterns
Demo Teardown
Selective Cleanup
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/az-azure-deploy/SKILL.md
Popularity
- Repository stars
- 31
- Repository forks
- 30
- 7-day trend score
- 17
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 15 Sep 2026, 2 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microsoftlearning/trainer-demo-deploy/az-azure-deploy)