preset
microsoft/skills
透過檢查各區域的容量並部署到最佳可用選項,自動化 Azure OpenAI 模型的部署。
...展開全部將模型部署至最優區域
透過檢查各區域的容量並部署到最佳可用選項,自動化智慧 Azure OpenAI 模型部署過程。
此技能的功能
- 驗證 Azure 身份驗證和專案範圍
- 檢查當前專案所在區域的容量
- 若無容量:分析所有區域並顯示可用的替代方案
- 按選定區域篩選專案
- 支援在需要時建立新專案
- 使用 GlobalStandard SKU 部署模型
- 監控部署進度
前提條件
- 已安裝並配置 Azure CLI
- 擁有認知服務讀取/建立許可權的活躍 Azure 訂閱
- Azure AI Foundry 專案資源 ID(
PROJECT_RESOURCE_ID環境變數或互動式提供)- 格式:
/subscriptions/{sub-id}/resourceGroups/{rg}/providers/Microsoft.CognitiveServices/accounts/{account}/projects/{project} - 查詢位置:Azure AI Foundry 門戶 → 專案 → 概述 → 資源 ID
- 格式:
快速工作流
快速路徑(當前區域有容量)
1. 檢查身份驗證 → 2. 獲取專案 → 3. 檢查當前區域容量
→ 4. 立即部署
備用區域路徑(無容量)
1. 檢查身份驗證 → 2. 獲取專案 → 3. 檢查當前區域(無容量)
→ 4. 查詢所有區域 → 5. 顯示替代方案 → 6. 選擇區域 + 專案
→ 7. 部署
部署階段
| 階段 | 操作 | 關鍵命令 |
|---|---|---|
| 1. 驗證身份驗證 | 檢查 Azure CLI 登入和訂閱 | `az account show`, `az login` |
| 2. 獲取專案 | 解析 `PROJECT_RESOURCE_ID` ARM ID,驗證是否存在 | `az cognitiveservices account show` |
| 3. 獲取模型 | 列出可用模型,使用者選擇模型和版本 | `az cognitiveservices account list-models` |
| 4. 檢查當前區域 | 使用 GlobalStandard SKU 查詢容量 | `az rest --method GET .../modelCapacities` |
| 5. 多區域查詢 | 如果本地無容量,查詢所有區域 | 不帶位置過濾器的相同容量 API |
| 6. 選擇區域 + 專案 | 使用者選擇區域;查詢或建立專案 | `az cognitiveservices account list`, `az cognitiveservices account create` |
| 7. 部署 | 生成唯一名稱,計算容量(50% 可用,最低 50 TPM),建立部署 | `az cognitiveservices account deployment create` |
有關詳細的分步說明,請參閱工作流參考。
錯誤處理
| 錯誤 | 症狀 | 解決方案 |
|---|---|---|
| 身份驗證失敗 | `az account show` 返回錯誤 | 執行 `az login` 然後 `az account set --subscription |
| 無配額 | 所有區域顯示容量為 0 | 轉至配額技能以處理增加請求和故障排除;檢查現有部署;嘗試其他模型 |
| 未找到模型 | 容量列表為空 | 使用 `az cognitiveservices account list-models` 驗證模型名稱;檢查大小寫敏感性 |
| 名稱衝突 | “部署已存在” | 在部署名稱後附加字尾(由 `generate_deployment_name` 指令碼自動處理) |
| 區域不可用 | 區域不支援該模型 | 從可用列表中選擇其他區域 |
| 許可權被拒絕 | “禁止”或“未經授權” | 驗證認知服務貢獻者角色:`az role assignment list --assignee |
高階用法
# 自定義容量
az cognitiveservices account deployment create ... --sku-capacity <value>
# 檢查部署狀態
az cognitiveservices account deployment show --name <acct> --resource-group <rg> --deployment-name <name> --query "{Status:properties.provisioningState}"
# 刪除部署
az cognitiveservices account deployment delete --name <acct> --resource-group <rg> --deployment-name <name>注意事項
- SKU: 僅限 GlobalStandard — API 版本: 2024-10-01(GA 穩定版)
相關技能
- microsoft-foundry - Azure AI Foundry 操作的父級技能
- quota — 用於檢視配額、增加請求和處理配額錯誤,請轉至此技能
- azure-quick-review - 審查 Azure 資源以符合合規性要求
- azure-cost-estimation - 估算 Azure 部署的成本
- azure-validate - 在部署前驗證 Azure 基礎設施
---
name: preset
description: Automates Azure OpenAI model deployment by checking capacity across regions and deploying to the best available option.
license: MIT
---
# Deploy Model to Optimal Region
Automates intelligent Azure OpenAI model deployment by checking capacity across regions and deploying to the best available option.
## What This Skill Does
1. Verifies Azure authentication and project scope
2. Checks capacity in current project's region
3. If no capacity: analyzes all regions and shows available alternatives
4. Filters projects by selected region
5. Supports creating new projects if needed
6. Deploys model with GlobalStandard SKU
7. Monitors deployment progress
## Prerequisites
- Azure CLI installed and configured
- Active Azure subscription with Cognitive Services read/create permissions
- Azure AI Foundry project resource ID (`PROJECT_RESOURCE_ID` env var or provided interactively)
- Format: `/subscriptions/{sub-id}/resourceGroups/{rg}/providers/Microsoft.CognitiveServices/accounts/{account}/projects/{project}`
- Found in: Azure AI Foundry portal → Project → Overview → Resource ID
## Quick Workflow
### Fast Path (Current Region Has Capacity)
```
1. Check authentication → 2. Get project → 3. Check current region capacity
→ 4. Deploy immediately
```
### Alternative Region Path (No Capacity)
```
1. Check authentication → 2. Get project → 3. Check current region (no capacity)
→ 4. Query all regions → 5. Show alternatives → 6. Select region + project
→ 7. Deploy
```
---
## Deployment Phases
| Phase | Action | Key Commands |
|-------|--------|-------------|
| 1. Verify Auth | Check Azure CLI login and subscription | `az account show`, `az login` |
| 2. Get Project | Parse `PROJECT_RESOURCE_ID` ARM ID, verify exists | `az cognitiveservices account show` |
| 3. Get Model | List available models, user selects model + version | `az cognitiveservices account list-models` |
| 4. Check Current Region | Query capacity using GlobalStandard SKU | `az rest --method GET .../modelCapacities` |
| 5. Multi-Region Query | If no local capacity, query all regions | Same capacity API without location filter |
| 6. Select Region + Project | User picks region; find or create project | `az cognitiveservices account list`, `az cognitiveservices account create` |
| 7. Deploy | Generate unique name, calculate capacity (50% available, min 50 TPM), create deployment | `az cognitiveservices account deployment create` |
For detailed step-by-step instructions, see [workflow reference](references/workflow.md).
---
## Error Handling
| Error | Symptom | Resolution |
|-------|---------|------------|
| Auth failure | `az account show` returns error | Run `az login` then `az account set --subscription <id>` |
| No quota | All regions show 0 capacity | Defer to the [quota skill](../../../quota/quota.md) for increase requests and troubleshooting; check existing deployments; try alternative models |
| Model not found | Empty capacity list | Verify model name with `az cognitiveservices account list-models`; check case sensitivity |
| Name conflict | "deployment already exists" | Append suffix to deployment name (handled automatically by `generate_deployment_name` script) |
| Region unavailable | Region doesn't support model | Select a different region from the available list |
| Permission denied | "Forbidden" or "Unauthorized" | Verify Cognitive Services Contributor role: `az role assignment list --assignee <user>` |
---
## Advanced Usage
```bash
# Custom capacity
az cognitiveservices account deployment create ... --sku-capacity <value>
# Check deployment status
az cognitiveservices account deployment show --name <acct> --resource-group <rg> --deployment-name <name> --query "{Status:properties.provisioningState}"
# Delete deployment
az cognitiveservices account deployment delete --name <acct> --resource-group <rg> --deployment-name <name>
```
## Notes
- **SKU:** GlobalStandard only — **API Version:** 2024-10-01 (GA stable)
---
## Related Skills
- **microsoft-foundry** - Parent skill for Azure AI Foundry operations
- **[quota](../../../quota/quota.md)** — For quota viewing, increase requests, and troubleshooting quota errors, defer to this skill
- **azure-quick-review** - Review Azure resources for compliance
- **azure-cost-estimation** - Estimate costs for Azure deployments
- **azure-validate** - Validate Azure infrastructure before deployment
所有檔案
0 個檔案安裝 preset
將技能檔案下載並解壓至你的 .claude/skills/ 目錄。
下載 ZIP複製儲存庫並將技能檔案複製到您的專案中。
git clone https://github.com/microsoft/skills/tree/main/.github/plugins/azure-skills/skills/microsoft-foundry/models/deploy-model/preset # Copy SKILL.md to your .claude/skills/ directory
複製





首頁
