All skills
microsoft avatar

/preset

@cda1f27 official

Intelligently deploys Azure OpenAI models to optimal regions by analyzing capacity across all available regions. Automatically checks current region first and shows alternatives if needed. USE FOR: quick deployment, optimal region, best region, automatic region selection, fast setup, multi-region capacity check, high availability deployment, deploy to best location. DO NOT USE FOR: custom SKU selection (use customize), specific version selection (use customize), custom capacity configuration (use customize), PTU deployments (use customize).

  • 4 files
  • 35.4 KB
  • MIT
  • Updated last week
  • GitHub

Use this Skill: https://skilld.dev/gh/microsoft/github-copilot-for-azure/preset

This session only. Nothing lands on disk.

referencesworkflow.md

≈1.4k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Preset Deployment Workflow — Step-by-Step

Condensed implementation reference for preset (optimal region) model deployment. See SKILL.md for overview.

Table of Contents: Phase 1: Verify Authentication · Phase 2: Get Current Project · Phase 3: Get Model Name · Phase 4: Check Current Region Capacity · Phase 5: Query Multi-Region Capacity · Phase 6: Select Region and Project · Phase 7: Deploy Model


Phase 1: Verify Authentication

az account show --query "{Subscription:name, User:user.name}" -o table

If not logged in: az login

Switch subscription:

az account list --query "[].[name,id,state]" -o table
az account set --subscription <subscription-id>

Phase 2: Get Current Project

Read PROJECT_RESOURCE_ID from env or prompt user. Format: /subscriptions/{sub-id}/resourceGroups/{rg}/providers/Microsoft.CognitiveServices/accounts/{account}/projects/{project}

Parse ARM ID components:

SUBSCRIPTION_ID=$(echo "$PROJECT_RESOURCE_ID" | sed -n 's|.*/subscriptions/\([^/]*\).*|\1|p')
RESOURCE_GROUP=$(echo "$PROJECT_RESOURCE_ID" | sed -n 's|.*/resourceGroups/\([^/]*\).*|\1|p')
ACCOUNT_NAME=$(echo "$PROJECT_RESOURCE_ID" | sed -n 's|.*/accounts/\([^/]*\)/projects.*|\1|p')
PROJECT_NAME=$(echo "$PROJECT_RESOURCE_ID" | sed -n 's|.*/projects/\([^/?]*\).*|\1|p')

Verify project exists and get region:

az account set --subscription "$SUBSCRIPTION_ID"

PROJECT_REGION=$(az cognitiveservices account show \
  --name "$PROJECT_NAME" \
  --resource-group "$RESOURCE_GROUP" \
  --query location -o tsv)

Phase 3: Get Model Name

If model not provided as parameter, list available models:

az cognitiveservices account list-models \
  --name "$PROJECT_NAME" \
  --resource-group "$RESOURCE_GROUP" \
  --query "[].name" -o tsv | sort -u

Get versions for selected model:

az cognitiveservices account list-models \
  --name "$PROJECT_NAME" \
  --resource-group "$RESOURCE_GROUP" \
  --query "[?name=='$MODEL_NAME'].{Name:name, Version:version, Format:format}" \
  -o table

Phase 4: Check Current Region Capacity

CAPACITY_JSON=$(az rest --method GET \
  --url "https://management.azure.com/subscriptions/$SUBSCRIPTION_ID/providers/Microsoft.CognitiveServices/locations/$PROJECT_REGION/modelCapacities?api-version=2024-10-01&modelFormat=OpenAI&modelName=$MODEL_NAME&modelVersion=$MODEL_VERSION")

CURRENT_CAPACITY=$(echo "$CAPACITY_JSON" | jq -r '.value[] | select(.properties.skuName=="GlobalStandard") | .properties.availableCapacity')

If CURRENT_CAPACITY > 0 → skip to Phase 7. Otherwise continue to Phase 5.


Phase 5: Query Multi-Region Capacity

ALL_REGIONS_JSON=$(az rest --method GET \
  --url "https://management.azure.com/subscriptions/$SUBSCRIPTION_ID/providers/Microsoft.CognitiveServices/modelCapacities?api-version=2024-10-01&modelFormat=OpenAI&modelName=$MODEL_NAME&modelVersion=$MODEL_VERSION")

Extract available regions (capacity > 0):

AVAILABLE_REGIONS=$(echo "$ALL_REGIONS_JSON" | jq -r '.value[] | select(.properties.skuName=="GlobalStandard" and .properties.availableCapacity > 0) | "\(.location)|\(.properties.availableCapacity)"')

Extract unavailable regions:

UNAVAILABLE_REGIONS=$(echo "$ALL_REGIONS_JSON" | jq -r '.value[] | select(.properties.skuName=="GlobalStandard" and (.properties.availableCapacity == 0 or .properties.availableCapacity == null)) | "\(.location)|0"')

If no regions have capacity, defer to the quota skill for increase requests. Suggest checking existing deployments or trying alternative models like gpt-4o-mini.


Phase 6: Select Region and Project

Present available regions to user. Store selection as SELECTED_REGION.

Find projects in selected region:

PROJECTS_IN_REGION=$(az cognitiveservices account list \
  --query "[?kind=='AIProject' && location=='$SELECTED_REGION'].{Name:name, ResourceGroup:resourceGroup}" \
  --output json)

If no projects exist — create new:

az cognitiveservices account create \
  --name "$HUB_NAME" \
  --resource-group "$RESOURCE_GROUP" \
  --location "$SELECTED_REGION" \
  --kind "AIServices" \
  --sku "S0" --yes

az cognitiveservices account create \
  --name "$NEW_PROJECT_NAME" \
  --resource-group "$RESOURCE_GROUP" \
  --location "$SELECTED_REGION" \
  --kind "AIProject" \
  --sku "S0" --yes

Phase 7: Deploy Model

Generate unique deployment name using scripts/generate_deployment_name.sh:

DEPLOYMENT_NAME=$(bash scripts/generate_deployment_name.sh "$ACCOUNT_NAME" "$RESOURCE_GROUP" "$MODEL_NAME")

Calculate capacity — 50% of available, minimum 50 TPM:

SELECTED_CAPACITY=$(echo "$ALL_REGIONS_JSON" | jq -r ".value[] | select(.location==\"$SELECTED_REGION\" and .properties.skuName==\"GlobalStandard\") | .properties.availableCapacity")
DEPLOY_CAPACITY=$(( SELECTED_CAPACITY / 2 ))
[ "$DEPLOY_CAPACITY" -lt 50 ] && DEPLOY_CAPACITY=50

Create deployment:

az cognitiveservices account deployment create \
  --name "$ACCOUNT_NAME" \
  --resource-group "$RESOURCE_GROUP" \
  --deployment-name "$DEPLOYMENT_NAME" \
  --model-name "$MODEL_NAME" \
  --model-version "$MODEL_VERSION" \
  --model-format "OpenAI" \
  --sku-name "GlobalStandard" \
  --sku-capacity "$DEPLOY_CAPACITY"

Monitor with az cognitiveservices account deployment show ... --query "properties.provisioningState" until Succeeded or Failed.

Source: SKILL.md on GitHub

No third-party reports yet.

Signed by skilld at cda1f27. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last week
metadata
{
  "author": "Microsoft",
  "version": "1.0.1"
}
  • azure
  • openai
  • deployment
  • region-selection
  • capacity-planning
  • azure-cli
  • model-deployment
  • cognitive-services

README badge

README badge for microsoft/github-copilot-for-azure/preset

Deploys Azure OpenAI models to the best available region by checking capacity across all options and automatically selecting the optimal location. Handles cases where the current region lacks capacity by querying alternatives and creating projects as needed, using the GlobalStandard SKU and Azure CLI.

Generated from the current SKILL.md.

What happens if my current region has no capacity?
The skill automatically queries all available regions, displays alternatives with their available capacity, and lets you select a different region to deploy to.
Does this skill support custom SKU or capacity configuration?
No. This skill uses GlobalStandard SKU only with automatic capacity calculation. For custom SKU selection or specific capacity tuning, use the customize skill instead.
What permissions do I need in Azure?
You need Cognitive Services Contributor role on your Azure subscription to read capacity and create deployments.
Can I deploy to a specific model version?
The skill lists available models and versions for selection, but does not support forcing a specific version. Use the customize skill if you need explicit version control.
What should I do if all regions show zero capacity?
Defer to the quota skill to request a quota increase, check for existing deployments consuming quota, or try alternative models.

Generated from the current SKILL.md. These answers refresh after source changes.