Automates the setup and deployment of AI infrastructure on Azure using azd.
Install
mkdir -p .claude/skills/up-azure-samples && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/17813" && unzip -o skill.zip -d .claude/skills/up-azure-samples && rm skill.zipInstalls to .claude/skills/up-azure-samples
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Creates an azd environment, checks prerequisites (RBAC, model quota), provisions the AI agent app infrastructure via `azd up`, and health-checks the deployed app.Key capabilities
- →Creates an azd environment
- →Checks prerequisites like RBAC and model quota
- →Provisions AI agent app infrastructure via `azd up`
- →Health-checks the deployed app
- →Resolves existing environment or suggests new names
- →Resolves Azure subscription and region
How it works
The skill orchestrates the end-to-end deployment of an AI agent app on Azure by checking prerequisites, provisioning infrastructure, and performing health checks.
Inputs & outputs
When to use up
- →Provisioning a new Azure environment
- →Deploying AI applications
- →Verifying app deployment health
About this skill
Up Skill
Goal
Provision a fresh Azure environment end-to-end and verify the app starts successfully.
Before starting
When the skill is triggered, always re-read this SKILL.md file from disk before executing, in case it has been updated since the last run.
Then proceed to Step 1 (Choose environment name) immediately — the user must pick an environment before anything else.
Terminal usage
All shell commands in this skill must be run using the powershell tool with
mode="sync". Use a short initial_wait (30 seconds) for quick commands like
az account show, az ad signed-in-user show, az role assignment list,
azd env list, azd env new, and azd env set.
Exception — azd up and azd down: These long-running commands must be run
with mode="async" and a short initial_wait (10 seconds) so the user can see
streaming progress output in real time (just like running in a terminal). After
launching, poll frequently using read_powershell with a short delay (15–20
seconds) — this is critical so the user sees output updates as they happen, similar
to watching the command in a terminal. Keep calling read_powershell in a loop
(each call in a new response turn) until the command completes or you receive a
completion notification. Do NOT use long delays like 120 seconds — that defeats the
purpose of streaming output.
Chain short related commands with && or ; into a single powershell call
when they have no branching logic between them.
Steps
1. Choose environment name
1a. Resolve existing environment
First, check whether there is already a default azd environment:
$existingEnvs = azd env list -o json 2>$null | ConvertFrom-Json
Find the default environment (the entry where IsDefault is true or the DefaultEnvironment
field is set, depending on the azd version).
1b. Generate a suggested new name
Regardless of whether a default environment exists, always prepare a suggested new name for use as a choice.
Scan $existingEnvs for names matching the pattern <prefix><number> (e.g., agent1,
test-env3, agent-qt-2). If found, take the one with the highest number and suggest
the next increment (e.g., agent2, test-env4, agent-qt-3).
If no numbered environments exist, generate a default name:
$suffix = -join ((0..9) + ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') | Get-Random -Count 6)
$suggestedName = "agent-qt-$suffix"
1c. Ask the user
If a default environment was found, present the user with choices:
- Use the current environment
<defaultEnvName>— re-provision/update the existing environment (first choice, include the environment name in the label) - Create a new environment
<suggestedName>— use the suggested new name from 1b - Enter a different name — the user provides their own name
For example:
Do you want to
azd upthe current environmentagent-qt-2, or create a new one?
If no default environment was found, present the user with choices:
- Use the suggested name
<suggestedName>— use the name generated in 1b - Enter a different name — the user provides their own name
- If the user provides a different name, use their name instead.
- Environment names must be lowercase alphanumeric and hyphens only, max 64 characters.
The resource group will be rg-<envName>.
1½. Check for existing AI project (shortcut)
After resolving the environment name, check whether the selected environment already has
AZURE_EXISTING_AIPROJECT_RESOURCE_ID set:
$existingProject = azd env get-value AZURE_EXISTING_AIPROJECT_RESOURCE_ID --environment $envName 2>$null
If the value is non-empty, the environment is pre-configured to use an existing AI project.
Print the short-path steps overview and jump directly to Step 9 (azd up):
Up Skill — Steps Overview (environment:
<envName>, existing AI project)
- ✅ Choose environment name 2–8. ⏭️ Skipped (existing AI project detected)
- Run
azd up- Retrieve the app endpoint
- Health-check the app
- Report results
If the value is empty or not set, print the full-path steps overview and continue to Step 2:
Up Skill — Steps Overview (environment:
<envName>)
- ✅ Choose environment name
- Resolve subscription
- Check RBAC permissions
- Resolve region
- Check agent model quota
- Ask about Azure AI Search
- Check embedding model quota (if AI Search enabled)
- Create the azd environment and set overrides
- Run
azd up- Retrieve the app endpoint
- Health-check the app
- Report results
2. Resolve subscription
Auto-detect the default Azure Subscription ID using this priority order (use the first one found):
- Environment variable
AZURE_SUBSCRIPTION_ID azd config get defaults.subscription(may return empty)az account show --query id -o tsv(current Azure CLI login)
Present the user with 2 choices:
- Use the detected subscription — show the subscription ID (and name if available via
az account show --query "{id:id, name:name}" -o json) as the default choice - Enter a different subscription — prompt the user to input a subscription ID
If no subscription was detected, skip choice 1 and ask the user to provide one directly.
Show the resolved subscription to the user for confirmation before proceeding.
3. Check RBAC permissions (prerequisite)
Verify the user has sufficient permissions to create role assignments on the subscription, which is required for provisioning. The user needs Owner or User Access Administrator — either assigned directly or inherited through a group membership.
3a. Check direct role assignments
$principalId = az ad signed-in-user show --query id -o tsv
$subScope = "/subscriptions/<subscriptionId>"
$roles = az role assignment list --assignee $principalId --scope $subScope --query "[].roleDefinitionName" -o json | ConvertFrom-Json
Check if $roles contains Owner or User Access Administrator.
- If yes, proceed to Step 4.
- If no, continue to 3b to check group-based assignments.
3b. Check group-based role assignments
The user may hold the required role through a group membership. Query the user's group memberships and check whether any of those groups have the required roles on the subscription.
$groupIds = az ad signed-in-user get-member-of --query "[].id" -o json | ConvertFrom-Json
If $groupIds is non-empty, check role assignments for each group on the subscription:
$groupRoles = @()
foreach ($gid in $groupIds) {
$gr = az role assignment list --assignee $gid --scope $subScope --query "[].roleDefinitionName" -o json 2>$null | ConvertFrom-Json
if ($gr) { $groupRoles += $gr }
}
Check if $groupRoles contains Owner or User Access Administrator.
- If yes, proceed to Step 4.
- If no, report the issue:
- Show the subscription name and ID that failed the check
- Show the user's current roles on the subscription
- Explain that
azd upwill fail because the deployment createsMicrosoft.Authorization/roleAssignments - Present 3 choices:
- "I just added the role — re-check" → Re-run the RBAC check on the same subscription
- "Use a different subscription" → Prompt the user for a new subscription ID, then go back to Step 3
- "Exit" → Stop the skill
4. Resolve region
Check environment variable AZURE_LOCATION first. If not set,
ask the user — must be one of: eastus, eastus2, swedencentral, westus, westus3.
Default to eastus if the user has no preference.
Show the resolved region to the user for confirmation before proceeding.
5. Check agent model quota (prerequisite)
Before provisioning, verify the default agent model has sufficient quota in the selected region.
Default model: gpt-5-mini | SKU: GlobalStandard | Required capacity: 80
5a. Query quota and model availability
$usage = az cognitiveservices usage list --location <region> --subscription <subscriptionId> -o json | ConvertFrom-Json
$modelList = az cognitiveservices model list --location <region> --subscription <subscriptionId> -o json | ConvertFrom-Json
Cache both $usage and $modelList — they are reused in Step 7 for embedding checks.
5b. Check default agent model quota
$defaultUsageName = "OpenAI.GlobalStandard.gpt-5-mini"
$entry = $usage | Where-Object { $_.name.value -eq $defaultUsageName }
If the entry exists, compute available = limit - currentValue.
- If
available >= 80, the default model has enough quota — skip to Step 6. - If the entry is missing, the model/SKU is not available in this region — continue to 5c.
- If
available < 80, quota is insufficient — continue to 5c.
Report the finding to the user (e.g., "gpt-5-mini has 40/80 quota available — insufficient").
5c. Find alternative agent models
From the quota usage list, find all GPT entries with Global or GlobalStandard SKUs
that have sufficient available quota:
$gptEntries = $usage | Where-Object {
$_.name.value -match '^OpenAI\.(Global|GlobalStandard)\.gpt-' -and
($_.limit - $_.currentValue) -ge 80
}
For each candidate, cross-reference with $modelList to confirm the model is actually
deployable (exists with format OpenAI and is not retired). Discard any candidate not
confirmed by the model list.
5d. Rank agent model candidates
Use this preference order (higher is better):
gpt-5.2gpt-5.2-minigpt-5.1gpt-5.1-minigpt-5gpt-5-minigpt-4.1gpt-4.1-minigpt-4ogpt-4o-mini
Within the same model name, prefer GlobalStandard over Global.
5e. Suggest the best al
Content truncated.
When not to use it
- →When the user does not want to choose an environment name
- →When the user does not want to check RBAC permissions
- →When the user does not want to check agent model quota
Limitations
- →Requires `powershell` tool with `mode="sync"` for most commands
- →Requires `azd up` and `azd down` to be run with `mode="async"`
- →Environment names must be lowercase alphanumeric and hyphens only, max 64 characters
How it compares
This skill automates the entire Azure deployment process for an AI agent app, including environment setup, prerequisite checks, infrastructure provisioning, and health checks, unlike manual Azure deployments.
Compared to similar skills
up side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| up (this skill) | 0 | 3mo | Review | Intermediate |
| azure-infra-review | 0 | 3mo | No flags | Intermediate |
| aspire | 0 | 3mo | Review | Advanced |
| azure-deployment-preflight | 7 | 6mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by Azure-Samples
View all by Azure-Samples →You might also like
azure-infra-review
aldelar
Reviews Bicep modules, azure.yaml, and infrastructure changes for the KB Agent project. Checks naming, RBAC, module wiring, and doc sync. Use when working on infra/ or reviewing infrastructure PRs.
aspire
davidortinau
**WORKFLOW SKILL** - Orchestrates Aspire applications using the Aspire CLI and MCP tools for running, debugging, deploying, and managing distributed apps. USE FOR: aspire run, aspire stop, aspire deploy, start aspire app, aspire describe, list aspire integrations, debug aspire issues, view aspire lo
azure-deployment-preflight
github
Performs comprehensive preflight validation of Bicep deployments to Azure, including template syntax validation, what-if analysis, and permission checks. Use this skill before any deployment to Azure to preview changes, identify potential issues, and ensure the deployment will succeed. Activate when users mention deploying to Azure, validating Bicep files, checking deployment permissions, previewing infrastructure changes, running what-if, or preparing for azd provision.
azure-image-builder
hashicorp
Build Azure managed images and Azure Compute Gallery images with Packer. Use when creating custom images for Azure VMs.
enter-services
pollinations
Deploy and manage enter.pollinations.ai text/image services on EC2 and Cloudflare Workers. Requires: SSH keys, sops, wrangler.
iac-common
jonathan-vella
**UTILITY SKILL** — Shared IaC deploy patterns for Bicep + Terraform agents: deployment strategies, circuit breaker, known deploy issues. WHEN: "phased deployment", "circuit breaker", "deploy strategy", "deploy issue", "shared IaC pattern". DO NOT USE FOR: preflight (azure-validate), code generation