deploy-model
microsoft/skills
建立具備智慧型意圖導向路由功能的 Azure OpenAI 模型部署,支援快速預設、完全自訂,以及跨區域與專案的容量偵測。
...展開全部部署模型
適用範圍 — 請先閱讀此部分。此技能會透過 Azure CLI / MCP / 入口網站,以「帶外」方式建立模型部署。對於由 azd 管理的 Foundry 專案(即從
azd-ai-starter-basic生成骨架,或透過azd ai agent init建立的專案),請在azure.yaml 的 services 區段中宣告部署。若改用 .config.deployments[]—azd ai agent init會從範例清單中寫入該項目,而azd provision則會透過 Bicep 建立部署。請參閱 foundry-agent/create/create-hosted.md 以了解黃金路徑。 僅在以下情況使用此功能:(a) 非由 azd 專案管理的 Foundry 專案,(b) 位於 azd 生命週期之外的臨時部署。
所有 Azure OpenAI 模型部署工作流程的統一入口點。會分析使用者意圖,並導向至適當的部署模式。
快速參考
| 模式 | 何時使用 | 子技能 |
|---|---|---|
| 預設 | 快速部署,無需自訂 | 預設設定/SKILL.md |
| 自訂 | 完全控制:版本、SKU、容量、RAI 政策 | customize/SKILL.md |
| 容量偵測 | 尋找可部署特定容量的位置 | capacity/SKILL.md |
意圖偵測
分析使用者的提示語,並導向至正確的模式:
使用者提示
│
├─ 簡易部署(無修飾詞)
│ 「部署 gpt-4o」、「設定模型」
│ └─> PRESET 模式
│
├─ 存在自訂關鍵字
│ "自訂設定"、"選擇版本"、"選擇 SKU"、
│ "將容量設為 X"、"設定內容過濾器"、
│ 「PTU 部署」、「使用特定配額」
│ └─> 自訂模式
│
├─ 容量/可用性查詢
│ 「查詢可部署位置」、「檢查容量」,
│ 「哪個區域有 X 容量」、「適合 10K TPM 的最佳區域」,
│ 「此模型可在何處取得」
│ └─> 容量探索模式
│
└─ 含糊不清(同時包含容量目標與部署意圖)
「將 GPT-4o 以 10K 容量部署至最佳區域」
└─> 先進行『容量探索』模式 → 再選擇『預設』或『自訂』模式
路由規則
| 提示字元中的訊號 | 路由至 | 理由 |
|---|---|---|
| 僅有模型名稱,無選項 | 預設 | 使用者希望快速部署 |
| 「自訂」、「設定」、「選擇」、「選取」 | 自訂 | 使用者希望掌握控制權 |
| 「尋找」、「檢查」、「在哪裡」、「哪個地區」、「可用」 | 容量 | 使用者希望進行資源探索 |
| 具體容量數值 + 「最佳區域」 | 容量 → 預設值 | 先進行資源偵測,再快速部署 |
| 具體容量數值 + 「自訂」關鍵字 | 容量 → 自訂 | 自動偵測並搭配選項進行部署 |
| 「PTU」、「已配置吞吐量」 | 自訂 | PTU 需選擇 SKU |
| 「最佳區域」、「最適區域」(無容量目標) | 預設 | 區域優化是預設選項的專長 |
多模式鏈接
某些提示需要依序執行兩種模式:
模式:容量 → 部署 當使用者指定容量需求且希望進行部署時:
- 執行容量探索,以找出具備充足配額的區域/專案
- 將搜尋結果呈現給使用者
- 詢問:「您要使用快速預設值進行部署,還是自訂設定?」
- 根據回答引導至「預設」或「自訂」
💡提示:若不確定使用者希望採用哪種模式,請預設為「預設值」(快速部署)。需要自訂設定的使用者通常會使用「自訂」、「配置」或「使用特定設定」等明確關鍵字。
專案選取(所有模式)
在進行任何部署之前,請先確定要部署至哪個專案。此步驟適用於所有模式(預設、自訂以及容量偵測後)。
確定順序
- 檢查環境變數
PROJECT_RESOURCE_ID— 若已設定,則以此作為預設值 - 檢查使用者提示— 若使用者指定了特定專案或區域,則採用該設定
- 若兩者皆無— 查詢使用者的專案並建議當前專案
確認步驟(必填)
部署前務必確認目標。向使用者顯示將使用的設定,並給予其變更的機會:
部署至:
專案:
區域:
資源:
這是否正確?或選擇其他專案:
1. ✅ 是,部署至此處(預設)
2. 📋 顯示此區域中的其他專案
3. 🌍 選擇其他區域
若使用者選擇選項 2,請顯示該區域的前 5 個專案:
中的專案:
1. project-alpha (rg-alpha)
2. project-beta (rg-beta)
3. project-gamma (rg-gamma)
...
⚠️切勿在未向使用者顯示將使用哪個專案的情況下進行部署。此舉可避免誤將資源部署至錯誤的目標。
部署前驗證(所有模式)
在呈現任何部署選項(SKU、容量)之前,務必驗證以下兩項:
模型是否支援該 SKU— 查詢模型目錄以確認所選的模型+版本是否支援目標 SKU:
az cognitiveservices model list --location--subscription -o json 篩選該模型,並擷取
.model.skus[].name以取得受支援的 SKU。訂閱具備可用配額— 檢查使用者的訂閱是否針對該 SKU 與模型的組合擁有未分配的配額:
az cognitiveservices usage list --location--subscription -o json 根據使用量名稱模式
OpenAI.進行比對(例如:. OpenAI.GlobalStandard.gpt-4o)。可用配額 = 限額 - 當前值。
⚠️警告:僅顯示同時通過兩項檢查的選項。切勿顯示硬編碼的 SKU 清單 — 務必始終動態查詢。可用配額為 0 的 SKU 應顯示為 ❌ 資訊性項目,而非可選選項。
💡配額管理:針對配額增加請求、使用量監控及配額錯誤疑難排解,請參照配額技能,而非在內嵌內容中重複相關指引。
先決條件
所有部署模式均需:
- 已安裝並完成驗證的 Azure CLI(
az login) - 具備部署權限且有效的 Azure 訂閱
- Azure AI Foundry 專案資源 ID(否則代理程式將透過
PROJECT_RESOURCE_ID環境變數協助偵測)
子技能
- preset/SKILL.md— 採用合理的預設值,快速部署至最佳區域
- customize/SKILL.md— 互動式引導流程,具備完整的配置控制權
- capacity/SKILL.md— 偵測跨區域與專案的可用容量
---
name: deploy-model
description: Creates Azure OpenAI model deployments with intelligent intent-based routing, supporting quick presets, full customization, and capacity discovery across regions and projects.
license: MIT
---
# Deploy Model
> **Scope — read this first.** This skill creates model deployments **out-of-band** via Azure CLI / MCP / portal. For azd-managed Foundry projects (those scaffolded from `azd-ai-starter-basic` or via `azd ai agent init`), declare deployments in `azure.yaml services.<name>.config.deployments[]` instead — `azd ai agent init` writes the entry from the sample manifest and `azd provision` creates the deployment through Bicep. See [foundry-agent/create/create-hosted.md](../../foundry-agent/create/create-hosted.md) for the Golden Path. Use this skill only for: (a) Foundry projects not managed by an azd project, (b) ad-hoc deployments outside the azd lifecycle.
Unified entry point for all Azure OpenAI model deployment workflows. Analyzes user intent and routes to the appropriate deployment mode.
## Quick Reference
| Mode | When to Use | Sub-Skill |
|------|-------------|-----------|
| **Preset** | Quick deployment, no customization needed | [preset/SKILL.md](preset/SKILL.md) |
| **Customize** | Full control: version, SKU, capacity, RAI policy | [customize/SKILL.md](customize/SKILL.md) |
| **Capacity Discovery** | Find where you can deploy with specific capacity | [capacity/SKILL.md](capacity/SKILL.md) |
## Intent Detection
Analyze the user's prompt and route to the correct mode:
```
User Prompt
│
├─ Simple deployment (no modifiers)
│ "deploy gpt-4o", "set up a model"
│ └─> PRESET mode
│
├─ Customization keywords present
│ "custom settings", "choose version", "select SKU",
│ "set capacity to X", "configure content filter",
│ "PTU deployment", "with specific quota"
│ └─> CUSTOMIZE mode
│
├─ Capacity/availability query
│ "find where I can deploy", "check capacity",
│ "which region has X capacity", "best region for 10K TPM",
│ "where is this model available"
│ └─> CAPACITY DISCOVERY mode
│
└─ Ambiguous (has capacity target + deploy intent)
"deploy gpt-4o with 10K capacity to best region"
└─> CAPACITY DISCOVERY first → then PRESET or CUSTOMIZE
```
### Routing Rules
| Signal in Prompt | Route To | Reason |
|------------------|----------|--------|
| Just model name, no options | **Preset** | User wants quick deployment |
| "custom", "configure", "choose", "select" | **Customize** | User wants control |
| "find", "check", "where", "which region", "available" | **Capacity** | User wants discovery |
| Specific capacity number + "best region" | **Capacity → Preset** | Discover then deploy quickly |
| Specific capacity number + "custom" keywords | **Capacity → Customize** | Discover then deploy with options |
| "PTU", "provisioned throughput" | **Customize** | PTU requires SKU selection |
| "optimal region", "best region" (no capacity target) | **Preset** | Region optimization is preset's specialty |
### Multi-Mode Chaining
Some prompts require two modes in sequence:
**Pattern: Capacity → Deploy**
When a user specifies a capacity requirement AND wants deployment:
1. Run **Capacity Discovery** to find regions/projects with sufficient quota
2. Present findings to user
3. Ask: "Would you like to deploy with **quick defaults** or **customize settings**?"
4. Route to **Preset** or **Customize** based on answer
> 💡 **Tip:** If unsure which mode the user wants, default to **Preset** (quick deployment). Users who want customization will typically use explicit keywords like "custom", "configure", or "with specific settings".
## Project Selection (All Modes)
Before any deployment, resolve which project to deploy to. This applies to **all** modes (preset, customize, and after capacity discovery).
### Resolution Order
1. **Check `PROJECT_RESOURCE_ID` env var** — if set, use it as the default
2. **Check user prompt** — if user named a specific project or region, use that
3. **If neither** — query the user's projects and suggest the current one
### Confirmation Step (Required)
**Always confirm the target before deploying.** Show the user what will be used and give them a chance to change it:
```
Deploying to:
Project: <project-name>
Region: <region>
Resource: <resource-group>
Is this correct? Or choose a different project:
1. ✅ Yes, deploy here (default)
2. 📋 Show me other projects in this region
3. 🌍 Choose a different region
```
If user picks option 2, show top 5 projects in that region:
```
Projects in <region>:
1. project-alpha (rg-alpha)
2. project-beta (rg-beta)
3. project-gamma (rg-gamma)
...
```
> ⚠️ **Never deploy without showing the user which project will be used.** This prevents accidental deployments to the wrong resource.
## Pre-Deployment Validation (All Modes)
Before presenting any deployment options (SKU, capacity), always validate both of these:
1. **Model supports the SKU** — query the model catalog to confirm the selected model+version supports the target SKU:
```bash
az cognitiveservices model list --location <region> --subscription <sub-id> -o json
```
Filter for the model, extract `.model.skus[].name` to get supported SKUs.
2. **Subscription has available quota** — check that the user's subscription has unallocated quota for the SKU+model combination:
```bash
az cognitiveservices usage list --location <region> --subscription <sub-id> -o json
```
Match by usage name pattern `OpenAI.<SKU>.<model-name>` (e.g., `OpenAI.GlobalStandard.gpt-4o`). Compute `available = limit - currentValue`.
> ⚠️ **Warning:** Only present options that pass both checks. Do NOT show hardcoded SKU lists — always query dynamically. SKUs with 0 available quota should be shown as ❌ informational items, not selectable options.
> 💡 **Quota management:** For quota increase requests, usage monitoring, and troubleshooting quota errors, defer to the [quota skill](../../quota/quota.md) instead of duplicating that guidance inline.
## Prerequisites
All deployment modes require:
- Azure CLI installed and authenticated (`az login`)
- Active Azure subscription with deployment permissions
- Azure AI Foundry project resource ID (or agent will help discover it via `PROJECT_RESOURCE_ID` env var)
## Sub-Skills
- **[preset/SKILL.md](preset/SKILL.md)** — Quick deployment to optimal region with sensible defaults
- **[customize/SKILL.md](customize/SKILL.md)** — Interactive guided flow with full configuration control
- **[capacity/SKILL.md](capacity/SKILL.md)** — Discover available capacity across regions and projects
所有檔案
0 個檔案安裝 deploy-model
請下載並將技能檔案解壓縮至您的 .claude/skills/ 目錄中。
下載 ZIP複製儲存庫並將技能檔案複製到您的專案中。
git clone https://github.com/microsoft/skills/tree/main/.github/plugins/azure-skills/skills/microsoft-foundry/models/deploy-model # Copy SKILL.md to your .claude/skills/ directory
複製





首頁
