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 模型部署工作流的统一入口点。分析用户意图并将其路由至相应的部署模式。
快速参考
| 模式 | 适用场景 | 子技能 |
|---|---|---|
| 预设 | 快速部署,无需自定义 | preset/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
复制





首页
