Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Build and deploy AI applications on Azure AI Foundry using Microsoft's model catalog and AI services
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
quota/references/workflows.md
1# Detailed Workflows: Quota Management23**Table of Contents:** [Workflow 1: View Current Quota Usage](#workflow-1-view-current-quota-usage---detailed-steps) · [Workflow 2: Find Best Region for Model Deployment](#workflow-2-find-best-region-for-model-deployment---detailed-steps) · [Workflow 3: Check Quota Before Deployment](#workflow-3-check-quota-before-deployment---detailed-steps) · [Workflow 4: Monitor Quota Across Deployments](#workflow-4-monitor-quota-across-deployments---detailed-steps) · [Quick Command Reference](#quick-command-reference) · [MCP Tools Reference](#mcp-tools-reference-optional-wrappers)45## Workflow 1: View Current Quota Usage - Detailed Steps67### Step 1: Show Regional Quota Summary (REQUIRED APPROACH)89> **CRITICAL AGENT INSTRUCTION:**10> - When showing quota: Query REGIONAL quota summary, NOT individual resources11> - DO NOT run `az cognitiveservices account list` for quota queries12> - DO NOT filter resources by username or name patterns13> - ONLY check specific resource deployments if user provides resource name14> - Quotas are managed at SUBSCRIPTION + REGION level, NOT per-resource1516**Show Regional Quota Summary:**1718```bash19# Get subscription ID20subId=$(az account show --query id -o tsv)2122# Check quota for key regions23regions=("eastus" "eastus2" "westus" "westus2")24for region in "${regions[@]}"; do25echo "=== Region: $region ==="26az rest --method get \27--url "https://management.azure.com/subscriptions/$subId/providers/Microsoft.CognitiveServices/locations/$region/usages?api-version=2023-05-01" \28--query "value[?contains(name.value,'OpenAI.Standard')].{Model:name.value, Used:currentValue, Limit:limit, Available:(limit-currentValue)}" \29--output table30echo ""31done32```3334### Step 2: If User Asks for Specific Resource (ONLY IF EXPLICITLY REQUESTED)3536```bash37# User must provide resource name38az cognitiveservices account deployment list \39--name <user-provided-resource-name> \40--resource-group <user-provided-rg> \41--query '[].{Name:name, Model:properties.model.name, Capacity:sku.capacity, SKU:sku.name}' \42--output table43```4445**Alternative - Use MCP Tools (Optional Wrappers):**46```47foundry_models_deployments_list(48resource-group="<rg>",49azure-ai-services="<resource-name>"50)51```52*Note: MCP tools are convenience wrappers around the same control plane APIs shown above.*5354**Interpreting Results:**55- `Used` (currentValue): Currently allocated quota56- `Limit`: Maximum quota available in region57- `Available`: Calculated as `limit - currentValue`5859## Workflow 2: Find Best Region for Model Deployment - Detailed Steps6061### Step 1: Check Single Region6263```bash64# Get subscription ID65subId=$(az account show --query id -o tsv)6667# Check quota for GPT-4o Standard in a specific region68region="eastus" # Change to your target region69az rest --method get \70--url "https://management.azure.com/subscriptions/$subId/providers/Microsoft.CognitiveServices/locations/$region/usages?api-version=2023-05-01" \71--query "value[?name.value=='OpenAI.Standard.gpt-4o'].{Model:name.value, Used:currentValue, Limit:limit, Available:(limit-currentValue)}" \72-o table73```7475### Step 2: Check Multiple Regions (Common Regions)7677Check these regions in sequence by changing the `region` variable:78- `eastus`, `eastus2` - US East Coast79- `westus`, `westus2`, `westus3` - US West Coast80- `swedencentral` - Europe (Sweden)81- `canadacentral` - Canada82- `uksouth` - UK83- `japaneast` - Asia Pacific8485**Alternative - Use MCP Tool:**86```87model_quota_list(region="eastus")88```89Repeat for each target region.9091**Key Points:**92- Query returns `currentValue` (used), `limit` (max), and calculated `Available`93- Standard SKU format: `OpenAI.Standard.<model-name>`94- For PTU: `OpenAI.ProvisionedManaged.<model-name>`95- Focus on 2-3 regions relevant to your location rather than checking all regions9697## Workflow 3: Check Quota Before Deployment - Detailed Steps9899**Steps:**1001. Check current usage (workflow #1)1012. Calculate available: `limit - currentValue`1023. Compare: `available >= required_capacity`1034. If insufficient: Use workflow #2 to find region with capacity, or request increase104105## Workflow 4: Monitor Quota Across Deployments - Detailed Steps106107**Recommended Approach - Regional Quota Overview:**108109Show quota by region (better than listing all resources):110111```bash112subId=$(az account show --query id -o tsv)113regions=("eastus" "eastus2" "westus" "westus2" "swedencentral")114115for region in "${regions[@]}"; do116echo "=== Region: $region ==="117az rest --method get \118--url "https://management.azure.com/subscriptions/$subId/providers/Microsoft.CognitiveServices/locations/$region/usages?api-version=2023-05-01" \119--query "value[?contains(name.value,'OpenAI')].{Model:name.value, Used:currentValue, Limit:limit, Available:(limit-currentValue)}" \120--output table121echo ""122done123```124125**Alternative - Check Specific Resource:**126127If user wants to monitor a specific resource, ask for resource name first:128129```bash130# List deployments for specific resource131az cognitiveservices account deployment list \132--name <resource-name> \133--resource-group <rg> \134--query '[].{Name:name, Model:properties.model.name, Capacity:sku.capacity}' \135--output table136```137138> **Note:** Don't automatically iterate through all resources in the subscription. Show regional quota summary or ask for specific resource name.139140## Quick Command Reference141142```bash143# View quota for specific model using REST API144subId=$(az account show --query id -o tsv)145region="eastus" # Change to your region146az rest --method get \147--url "https://management.azure.com/subscriptions/$subId/providers/Microsoft.CognitiveServices/locations/$region/usages?api-version=2023-05-01" \148--query "value[?contains(name.value,'gpt-4')].{Name:name.value, Used:currentValue, Limit:limit, Available:(limit-currentValue)}" \149--output table150151# List all deployments with capacity152az cognitiveservices account deployment list \153--name <resource-name> \154--resource-group <rg> \155--query '[].{Name:name, Model:properties.model.name, Capacity:sku.capacity}' \156--output table157158# Delete deployment to free quota159az cognitiveservices account deployment delete \160--name <resource-name> \161--resource-group <rg> \162--deployment-name <deployment-name>163```164165## MCP Tools Reference (Optional Wrappers)166167**Note:** All quota operations are control plane (management) operations. MCP tools are optional convenience wrappers around Azure CLI commands.168169| Tool | Purpose | Equivalent Azure CLI |170|------|---------|---------------------|171| `foundry_models_deployments_list` | List all deployments with capacity | `az cognitiveservices account deployment list` |172| `model_quota_list` | List quota and usage across regions | `az rest` (Management API) |173| `model_catalog_list` | List available models from catalog | `az rest` (Management API) |174| `foundry_resource_get` | Get resource details and endpoint | `az cognitiveservices account show` |175176**Recommended:** Use Azure CLI commands directly for control plane operations.177