azure-compute by microsoft/azure-skills
npx skills add https://github.com/microsoft/azure-skills --skill azure-compute通过分析工作负载类型、性能要求、扩展需求和预算,推荐 Azure 虚拟机规格、虚拟机规模集(VMSS)和配置。无需 Azure 订阅——所有数据均来自公共 Microsoft 文档和未经身份验证的零售价格 API。
使用参考文件进行初步筛选
关键:在做出最终推荐之前,务必使用来自 learn.microsoft.com 的最新文档进行验证。 如果
web_fetch失败,则使用参考文件作为备用,但要警告用户信息可能已过时。
向用户询问(尽可能推断):
| 需求 | 示例 |
|---|---|
| 工作负载类型 | Web 服务器、关系型数据库、机器学习训练、批处理、开发/测试 |
| vCPU / 内存需求 | "4 核,16 GB 内存" 或 "轻量级" / "重量级" |
| 需要 GPU 吗? | 是 → GPU 系列;否 → 通用/计算/内存优化 |
Recommend Azure VM sizes, VM Scale Sets (VMSS), and configurations by analyzing workload type, performance requirements, scaling needs, and budget. No Azure subscription required — all data comes from public Microsoft documentation and the unauthenticated Retail Prices API.
Use reference files for initial filtering
CRITICAL: then always verify with live documentation from learn.microsoft.com before making final recommendations. If
web_fetchfails, use reference files as fallback but warn the user the information may be stale.
Ask the user for (infer when possible):
| Requirement | Examples |
|---|
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
暂无相关 Skills
| 高 IOPS、大容量临时磁盘、高级 SSD |
| 预算优先级 | 成本敏感型、性能优先型、平衡型 |
| 操作系统 | Linux 或 Windows(影响定价) |
| 区域 | 影响可用性和价格 |
| 实例数量 | 单个实例、固定数量或可变/动态数量 |
| 扩展需求 | 无、手动扩展、基于指标或计划的自动扩展 |
| 可用性需求 | 尽力而为、容错域隔离、跨区域高可用性 |
| 负载均衡 | 不需要、Azure 负载均衡器(L4)、应用程序网关(L7) |
工作流程:
web_fetch https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/overview
web_fetch https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-autoscale-overview
web_fetch 失败,则继续使用参考文件中的指导,但包含此警告:
无法根据最新的 Azure 文档进行验证。推荐基于参考材料,可能未反映最近的更新。
需要自动缩放?
├─ 是 → VMSS
├─ 否
│ ├─ 需要多个相同实例?
│ │ ├─ 是 → VMSS
│ │ └─ 否
│ │ ├─ 需要跨容错域/区域的高可用性?
│ │ │ ├─ 是,多个实例 → VMSS
│ │ │ └─ 是,1-2 个实例 → 虚拟机 + 可用性区域
│ │ └─ 单个实例足够? → 虚拟机
| 信号 | 推荐 | 原因 |
|---|---|---|
| 基于 CPU、内存或计划的自动缩放 | VMSS | 内置自动缩放;无需自定义自动化 |
| 负载均衡器后的无状态 Web/API 层 | VMSS | 同构集群,自动分配流量 |
| 跨多个节点的批处理/并行处理 | VMSS | 按需横向扩展,空闲时缩放到零 |
| 一个组中混合使用多种虚拟机规格 | VMSS (Flexible) | Flexible 业务流程模式支持混合 SKU |
| 单个长期运行的服务器(跳板机、AD 域控制器) | 虚拟机 | 无扩展优势;管理更简单 |
| 需要每个实例的独特配置 | 虚拟机 | 规模集假定为同构配置 |
| 有状态工作负载、紧耦合集群 | 虚拟机(或视情况使用 VMSS) | 仔细评估;VMSS Flexible 模式可适用于某些有状态模式 |
警告: 如果用户不确定,为简单起见,默认使用单个虚拟机。仅当明确需要扩展、高可用性或集群管理时,才推荐 VMSS。
工作流程:
web_fetch https://learn.microsoft.com/en-us/azure/virtual-machines/sizes/<family-category>/<series-name>
示例:
https://learn.microsoft.com/en-us/azure/virtual-machines/sizes/general-purpose/b-familyhttps://learn.microsoft.com/en-us/azure/virtual-machines/sizes/general-purpose/ddsv5-serieshttps://learn.microsoft.com/en-us/azure/virtual-machines/sizes/gpu-accelerated/nc-familyweb_fetch https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/use-spot
web_fetch 失败,则继续使用参考文件中的指导,但包含此警告:
无法根据最新的 Azure 文档进行验证。推荐基于参考材料,可能未反映最近的更新或限制(例如,Spot 虚拟机兼容性)。
此步骤适用于单个虚拟机和 VMSS,因为规模集使用相同的虚拟机 SKU。
查询 Azure 零售价格 API —— 零售价格 API 指南
提示: VMSS 不额外收费——定价基于每个虚拟机实例。使用 API 中相同的虚拟机定价,并乘以预期的实例数量来估算 VMSS 成本。对于自动扩展的工作负载,估算最小和最大实例数量下的成本。
提供 2–3 个选项 并说明权衡:
| 列 | 用途 |
|---|---|
| 托管模型 | 虚拟机或 VMSS(如果是 VMSS,注明业务流程模式) |
| 虚拟机规格 | ARM SKU 名称(例如,Standard_D4s_v5) |
| vCPU / 内存 | 核心规格 |
| 实例数量 | 虚拟机为 1;具有自动扩展的 VMSS 为最小-最大范围 |
| 估计 $/小时 | 来自 API 的按实例即用即付价格 |
| 原因 | 适合该工作负载的原因 |
| 权衡 | 用户需要做出的取舍 |
提示: 始终解释为什么某个系列适合,以及用户需要权衡什么(成本与核心数、可突增与专用、单个虚拟机的简单性与 VMSS 的可扩展性等)。
对于 VMSS 推荐,还需提及:
priceType eq 'Reservation' 查询 API)| 场景 | 操作 |
|---|---|
| API 返回空结果 | 放宽筛选条件——检查 armRegionName、serviceName、armSkuName 的拼写 |
| 用户不确定工作负载类型 | 询问澄清性问题;默认使用通用 D 系列 |
| 未指定区域 | 使用 eastus 作为默认值;注意价格因区域而异 |
| 不清楚需要虚拟机还是 VMSS | 询问扩展和实例数量;如果不确定,默认使用单个虚拟机 |
| 用户直接询问 VMSS 定价 | 使用相同的虚拟机定价 API——VMSS 不额外收费;乘以实例数量 |
每周安装量
13.0K
代码仓库
GitHub Stars
2
首次出现
5 天前
安全审计
安装于
github-copilot13.0K
opencode11
gemini-cli11
codex11
amp10
cline10
| Workload type | Web server, relational DB, ML training, batch processing, dev/test |
| vCPU / RAM needs | "4 cores, 16 GB RAM" or "lightweight" / "heavy" |
| GPU needed? | Yes → GPU families; No → general/compute/memory |
| Storage needs | High IOPS, large temp disk, premium SSD |
| Budget priority | Cost-sensitive, performance-first, balanced |
| OS | Linux or Windows (affects pricing) |
| Region | Affects availability and price |
| Instance count | Single instance, fixed count, or variable/dynamic |
| Scaling needs | None, manual scaling, autoscale based on metrics or schedule |
| Availability needs | Best-effort, fault-domain isolation, cross-zone HA |
| Load balancing | Not needed, Azure Load Balancer (L4), Application Gateway (L7) |
Workflow:
Review VMSS Guide to understand when VMSS vs single VM is appropriate
Use the gathered requirements to decide which approach fits best
REQUIRED: If recommending VMSS , fetch current documentation to verify capabilities:
web_fetch https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/overview
web_fetch https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-autoscale-overview
Ifweb_fetch fails, proceed with reference file guidance but include this warning:
Unable to verify against latest Azure documentation. Recommendation based on reference material that may not reflect recent updates.
Needs autoscaling?
├─ Yes → VMSS
├─ No
│ ├─ Multiple identical instances needed?
│ │ ├─ Yes → VMSS
│ │ └─ No
│ │ ├─ High availability across fault domains / zones?
│ │ │ ├─ Yes, many instances → VMSS
│ │ │ └─ Yes, 1-2 instances → VM + Availability Zone
│ │ └─ Single instance sufficient? → VM
| Signal | Recommendation | Why |
|---|---|---|
| Autoscale on CPU, memory, or schedule | VMSS | Built-in autoscale; no custom automation needed |
| Stateless web/API tier behind a load balancer | VMSS | Homogeneous fleet with automatic distribution |
| Batch / parallel processing across many nodes | VMSS | Scale out on demand, scale to zero when idle |
| Mixed VM sizes in one group | VMSS (Flexible) | Flexible orchestration supports mixed SKUs |
| Single long-lived server (jumpbox, AD DC) | VM | No scaling benefit; simpler management |
| Unique per-instance config required | VM | Scale sets assume homogeneous configuration |
| Stateful workload, tightly-coupled cluster | VM (or VMSS case-by-case) | Evaluate carefully; VMSS Flexible can work for some stateful patterns |
Warning: If the user is unsure, default to single VM for simplicity. Recommend VMSS only when scaling, HA, or fleet management is clearly needed.
Workflow:
Review VM Family Guide to identify 2-3 candidate VM families that match the workload requirements
REQUIRED: verify specifications for your chosen candidates by fetching current documentation:
web_fetch https://learn.microsoft.com/en-us/azure/virtual-machines/sizes/<family-category>/<series-name>
Examples:
* B-series: `https://learn.microsoft.com/en-us/azure/virtual-machines/sizes/general-purpose/b-family`
* D-series: `https://learn.microsoft.com/en-us/azure/virtual-machines/sizes/general-purpose/ddsv5-series`
* GPU: `https://learn.microsoft.com/en-us/azure/virtual-machines/sizes/gpu-accelerated/nc-family`
3. If considering Spot VMs , also fetch:
web_fetch https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/use-spot
4. Ifweb_fetch fails, proceed with reference file guidance but include this warning:
Unable to verify against latest Azure documentation. Recommendation based on reference material that may not reflect recent updates or limitations (e.g., Spot VM compatibility).
This step applies to both single VMs and VMSS since scale sets use the same VM SKUs.
Query the Azure Retail Prices API — Retail Prices API Guide
Tip: VMSS has no extra charge — pricing is per-VM instance. Use the same VM pricing from the API and multiply by the expected instance count to estimate VMSS cost. For autoscaling workloads, estimate cost at both the minimum and maximum instance count.
Provide 2–3 options with trade-offs:
| Column | Purpose |
|---|---|
| Hosting Model | VM or VMSS (with orchestration mode if VMSS) |
| VM Size | ARM SKU name (e.g., Standard_D4s_v5) |
| vCPUs / RAM | Core specs |
| Instance Count | 1 for VM; min–max range for VMSS with autoscale |
| Estimated $/hr | Per-instance pay-as-you-go from API |
| Why | Fit for the workload |
| Trade-off | What the user gives up |
Tip: Always explain why a family fits and what the user trades off (cost vs cores, burstable vs dedicated, single VM simplicity vs VMSS scalability, etc.).
For VMSS recommendations, also mention:
priceType eq 'Reservation')| Scenario | Action |
|---|---|
| API returns empty results | Broaden filters — check armRegionName, serviceName, armSkuName spelling |
| User unsure of workload type | Ask clarifying questions; default to General Purpose D-series |
| Region not specified | Use eastus as default; note prices vary by region |
| Unclear if VM or VMSS needed | Ask about scaling and instance count; default to single VM if unsure |
| User asks VMSS pricing directly | Use same VM pricing API — VMSS has no extra charge; multiply by instance count |
Weekly Installs
13.0K
Repository
GitHub Stars
2
First Seen
5 days ago
Security Audits
Installed on
github-copilot13.0K
opencode11
gemini-cli11
codex11
amp10
cline10