azure-quotas by microsoft/github-copilot-for-azure
npx skills add https://github.com/microsoft/github-copilot-for-azure --skill azure-quotas权威指南 — 请严格按照这些说明进行配额管理和容量验证。
什么是 Azure 配额?
Azure 配额(也称为服务限制)是您可以在一个订阅中部署的资源的最大数量。配额:
核心概念:配额 = 资源可用性
如果您没有配额,就无法部署资源。在规划部署或选择区域时,请务必检查配额。
在以下情况下调用此技能:
| 属性 | 详细信息 |
|---|---|
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
Azure CLI (az quota) - 始终首先使用此工具 |
| 所需扩展 | az extension add --name quota(必须先安装) |
| 关键命令 | az quota list, az quota show, az quota usage list, az quota usage show |
| 完整 CLI 参考 | commands.md |
| Azure 门户 | 我的配额 - 仅作为备用方案使用 |
| REST API | Microsoft.Quota 提供程序 - 不可靠,请勿首先使用 |
| 所需权限 | 读取者(查看)或配额请求操作员(管理) |
⚠️ 关键:始终首先使用 CLI
Azure CLI (
az quota) 是检查配额的唯一可靠方法。始终首先使用 CLI。请勿将 REST API 或门户作为首选方法。 它们不可靠且具有误导性。
为何必须首先使用 CLI:
- REST API 不可靠,会显示误导性结果
- REST API 中的“无限制”或“无限”值并不意味着无限容量
- “无限制”通常意味着该资源不支持配额 API(并非无限!)
- 当提供程序不受支持时,CLI 会提供清晰的
BadRequest错误- CLI 具有一致的输出格式和更好的错误消息
- 门户可能显示不完整或缓存的数据
强制性工作流程:
- 首先: 尝试
az quota list/az quota show/az quota usage show- 如果 CLI 返回
BadRequest: 则使用 Azure 服务限制文档- 切勿从 REST API 或门户开始 - 仅作为最后手段使用
如果您在 REST API/门户中看到“无限制”: 这不是无限容量。它意味着:
- 配额 API 不支持该资源类型,或者
- 配额未通过 API 强制执行,或者
- 服务特定的限制仍然适用(请查阅文档)
有关完整的 CLI 命令参考和示例,请参阅 commands.md。
| 类型 | 可调整性 | 审批 | 示例 |
|---|---|---|---|
| 可调整 | 可通过门户/CLI/API 增加 | 通常自动批准 | VM vCPU、公共 IP、存储账户 |
| 不可调整 | 固定限制 | 无法更改 | 订阅范围的硬性限制 |
重要提示: 请求增加配额是免费的。您只需为实际使用的资源付费,而不是为配额分配付费。
⚠️ 关键: ARM 资源类型与配额资源名称之间没有 1:1 的映射关系。
| ARM 资源类型 | 配额资源名称 |
|---|---|
Microsoft.App/managedEnvironments | ManagedEnvironmentCount |
Microsoft.Compute/virtualMachines | standardDSv3Family, cores, virtualMachines |
Microsoft.Network/publicIPAddresses | PublicIPAddresses, IPv4StandardSkuPublicIpAddresses |
切勿从 ARM 类型推断配额资源名称。 始终使用此工作流程:
列出资源提供程序的所有配额:
az quota list --scope /subscriptions/<id>/providers/<ProviderNamespace>/locations/<region>
通过 localizedValue(人类可读的描述)进行匹配以找到相关配额
在后续命令中使用 name 字段(而非 ARM 资源类型):
az quota show --resource-name ManagedEnvironmentCount --scope ...
az quota usage show --resource-name ManagedEnvironmentCount --scope ...
📖 详细的映射示例和工作流程: 请参阅 commands.md - 理解资源名称映射
场景: 在部署前验证配额限制和当前使用量
# 1. 安装配额扩展(如果尚未安装)
az extension add --name quota
# 2. 列出该提供程序的所有配额以找到配额资源名称
az quota list \
--scope /subscriptions/<subscription-id>/providers/Microsoft.Compute/locations/eastus
# 3. 显示特定资源的配额限制
az quota show \
--resource-name standardDSv3Family \
--scope /subscriptions/<subscription-id>/providers/Microsoft.Compute/locations/eastus
# 4. 显示当前使用量
az quota usage show \
--resource-name standardDSv3Family \
--scope /subscriptions/<subscription-id>/providers/Microsoft.Compute/locations/eastus
输出示例分析:
📖 另请参阅: az quota show, az quota usage show
场景: 根据可用容量找到最佳部署区域
# 定义候选区域
REGIONS=("eastus" "eastus2" "westus2" "centralus")
VM_FAMILY="standardDSv3Family"
SUBSCRIPTION_ID="<subscription-id>"
# 检查跨区域的配额可用性
for region in "${REGIONS[@]}"; do
echo "=== 检查 $region ==="
# 获取限制
LIMIT=$(az quota show \
--resource-name $VM_FAMILY \
--scope "/subscriptions/$SUBSCRIPTION_ID/providers/Microsoft.Compute/locations/$region" \
--query "properties.limit.value" -o tsv)
# 获取当前使用量
USAGE=$(az quota usage show \
--resource-name $VM_FAMILY \
--scope "/subscriptions/$SUBSCRIPTION_ID/providers/Microsoft.Compute/locations/$region" \
--query "properties.usages.value" -o tsv)
# 计算可用量
AVAILABLE=$((LIMIT - USAGE))
echo "区域: $region | 限制: $LIMIT | 使用量: $USAGE | 可用: $AVAILABLE"
done
📖 另请参阅: 多区域比较脚本 (Bash & PowerShell)
场景: 当前配额不足以进行部署
# 请求增加 VM 配额
az quota update \
--resource-name standardDSv3Family \
--scope /subscriptions/<subscription-id>/providers/Microsoft.Compute/locations/eastus \
--limit-object value=500 \
--resource-type dedicated
# 检查请求状态
az quota request status list \
--scope /subscriptions/<subscription-id>/providers/Microsoft.Compute/locations/eastus
审批流程:
📖 另请参阅: az quota update, az quota request status
场景: 了解某个区域中资源提供程序的所有配额
# 列出美国东部所有计算配额(表格格式)
az quota list \
--scope /subscriptions/<subscription-id>/providers/Microsoft.Compute/locations/eastus \
--output table
# 列出所有网络配额
az quota list \
--scope /subscriptions/<subscription-id>/providers/Microsoft.Network/locations/eastus \
--output table
# 列出所有容器应用配额
az quota list \
--scope /subscriptions/<subscription-id>/providers/Microsoft.App/locations/eastus \
--output table
📖 另请参阅: az quota list
| 错误 | 原因 | 解决方案 |
|---|---|---|
| REST API "无限制" | REST API 显示误导性的“无限”值 | 关键:"无限制" ≠ 无限! 改用 CLI。参见上方警告。检查服务限制文档 |
| REST API 失败 | REST API 不可靠且具有误导性 | 始终使用 Azure CLI - 完整 CLI 参考请参阅 commands.md |
ExtensionNotFound | 未安装配额扩展 | az extension add --name quota |
BadRequest | 配额 API 不支持该资源提供程序 | 使用 CLI(首选)或服务限制文档 |
MissingRegistration | Microsoft.Quota 提供程序未注册 | az provider register --namespace Microsoft.Quota |
QuotaExceeded | 部署将超出配额 | 请求增加或选择其他区域 |
InvalidScope | 范围格式不正确 | 使用模式:/subscriptions/<id>/providers/<namespace>/locations/<region> |
已知不受支持的提供程序:
已确认可用的提供程序:
📖 另请参阅: 故障排除指南
| 资源 | 链接 |
|---|---|
| CLI 命令参考 | commands.md - 完整语法、参数、示例 |
| Azure 配额概述 | Microsoft Learn |
| 服务限制文档 | Azure 订阅限制 |
| Azure 门户 - 我的配额 | 门户链接 |
| 请求增加配额 | 如何请求增加 |
az quota list - 发现正确的配额资源名称--output table 用于快速浏览┌─────────────────────────────────────────┐
│ 1. 安装配额扩展 │
│ az extension add --name quota │
└─────────────────┬───────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ 2. 发现配额资源名称 │
│ az quota list --scope ... │
│ (通过 localizedValue 匹配) │
└─────────────────┬───────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ 3. 检查当前使用量 │
│ az quota usage show │
│ --resource-name <name> │
└─────────────────┬───────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ 4. 检查配额限制 │
│ az quota show │
│ --resource-name <name> │
└─────────────────┬───────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ 5. 验证容量 │
│ 可用 = 限制 - (使用量 + 需求) │
└─────────────────┬───────────────────────┘
│
▼
┌────────┴────────┐
│ │
✅ 充足 ❌ 不足
│ │
▼ ▼
继续部署 请求增加配额
或更改区域
每周安装数
363
代码仓库
GitHub 星标数
160
首次出现
2026年3月10日
安全审计
安装于
github-copilot349
codex54
gemini-cli53
kimi-cli45
amp45
cline45
AUTHORITATIVE GUIDANCE — Follow these instructions exactly for quota management and capacity validation.
What are Azure Quotas?
Azure quotas (also called service limits) are the maximum number of resources you can deploy in a subscription. Quotas:
Key Concept: Quotas = Resource Availability
If you don't have quota, you cannot deploy resources. Always check quotas when planning deployments or selecting regions.
Invoke this skill when:
| Property | Details |
|---|---|
| Primary Tool | Azure CLI (az quota) - USE THIS FIRST, ALWAYS |
| Extension Required | az extension add --name quota (MUST install first) |
| Key Commands | az quota list, az quota show, az quota usage list, az quota usage show |
⚠️ CRITICAL: ALWAYS USE CLI FIRST
Azure CLI (
az quota) is the ONLY reliable method for checking quotas. Use CLI FIRST, always.DO NOT use REST API or Portal as your first approach. They are unreliable and misleading.
Why you must use CLI first:
- REST API is unreliable and shows misleading results
- REST API "No Limit" or "Unlimited" values DO NOT mean unlimited capacity
- "No Limit" typically means the resource doesn't support quota API (not unlimited!)
- CLI provides clear
BadRequesterrors when providers aren't supported- CLI has consistent output format and better error messages
- Portal may show incomplete or cached data
Mandatory workflow:
- FIRST: Try
az quota list/az quota show/az quota usage show- If CLI returns
BadRequest: Then use Azure service limits docs- Never start with REST API or Portal - only use as last resort
If you see "No Limit" in REST API/Portal: This is NOT unlimited capacity. It means:
- The quota API doesn't support that resource type, OR
- The quota isn't enforced via the API, OR
- Service-specific limits still apply (check documentation)
For complete CLI command reference and examples, see commands.md.
| Type | Adjustability | Approval | Examples |
|---|---|---|---|
| Adjustable | Can increase via Portal/CLI/API | Usually auto-approved | VM vCPUs, Public IPs, Storage accounts |
| Non-adjustable | Fixed limits | Cannot be changed | Subscription-wide hard limits |
Important: Requesting quota increases is free. You only pay for resources you actually use, not for quota allocation.
⚠️ CRITICAL: There is NO 1:1 mapping between ARM resource types and quota resource names.
| ARM Resource Type | Quota Resource Name |
|---|---|
Microsoft.App/managedEnvironments | ManagedEnvironmentCount |
Microsoft.Compute/virtualMachines | standardDSv3Family, cores, virtualMachines |
Microsoft.Network/publicIPAddresses | PublicIPAddresses, |
Never assume the quota resource name from the ARM type. Always use this workflow:
List all quotas for the resource provider:
az quota list --scope /subscriptions/<id>/providers/<ProviderNamespace>/locations/<region>
Match bylocalizedValue (human-readable description) to find the relevant quota
Use thename field (not ARM resource type) in subsequent commands:
az quota show --resource-name ManagedEnvironmentCount --scope ...
az quota usage show --resource-name ManagedEnvironmentCount --scope ...
📖 Detailed mapping examples and workflow: See commands.md - Understanding Resource Name Mapping
Scenario: Verify quota limit and current usage before deployment
# 1. Install quota extension (if not already installed)
az extension add --name quota
# 2. List all quotas for the provider to find the quota resource name
az quota list \
--scope /subscriptions/<subscription-id>/providers/Microsoft.Compute/locations/eastus
# 3. Show quota limit for a specific resource
az quota show \
--resource-name standardDSv3Family \
--scope /subscriptions/<subscription-id>/providers/Microsoft.Compute/locations/eastus
# 4. Show current usage
az quota usage show \
--resource-name standardDSv3Family \
--scope /subscriptions/<subscription-id>/providers/Microsoft.Compute/locations/eastus
Example Output Analysis:
📖 See also: az quota show, az quota usage show
Scenario: Find the best region for deployment based on available capacity
# Define candidate regions
REGIONS=("eastus" "eastus2" "westus2" "centralus")
VM_FAMILY="standardDSv3Family"
SUBSCRIPTION_ID="<subscription-id>"
# Check quota availability across regions
for region in "${REGIONS[@]}"; do
echo "=== Checking $region ==="
# Get limit
LIMIT=$(az quota show \
--resource-name $VM_FAMILY \
--scope "/subscriptions/$SUBSCRIPTION_ID/providers/Microsoft.Compute/locations/$region" \
--query "properties.limit.value" -o tsv)
# Get current usage
USAGE=$(az quota usage show \
--resource-name $VM_FAMILY \
--scope "/subscriptions/$SUBSCRIPTION_ID/providers/Microsoft.Compute/locations/$region" \
--query "properties.usages.value" -o tsv)
# Calculate available
AVAILABLE=$((LIMIT - USAGE))
echo "Region: $region | Limit: $LIMIT | Usage: $USAGE | Available: $AVAILABLE"
done
📖 See also: Multi-region comparison scripts (Bash & PowerShell)
Scenario: Current quota is insufficient for deployment
# Request increase for VM quota
az quota update \
--resource-name standardDSv3Family \
--scope /subscriptions/<subscription-id>/providers/Microsoft.Compute/locations/eastus \
--limit-object value=500 \
--resource-type dedicated
# Check request status
az quota request status list \
--scope /subscriptions/<subscription-id>/providers/Microsoft.Compute/locations/eastus
Approval Process:
📖 See also: az quota update, az quota request status
Scenario: Understand all quotas for a resource provider in a region
# List all compute quotas in East US (table format)
az quota list \
--scope /subscriptions/<subscription-id>/providers/Microsoft.Compute/locations/eastus \
--output table
# List all network quotas
az quota list \
--scope /subscriptions/<subscription-id>/providers/Microsoft.Network/locations/eastus \
--output table
# List all Container Apps quotas
az quota list \
--scope /subscriptions/<subscription-id>/providers/Microsoft.App/locations/eastus \
--output table
📖 See also: az quota list
| Error | Cause | Solution |
|---|---|---|
| REST API "No Limit" | REST API showing misleading "unlimited" values | CRITICAL: "No Limit" ≠ unlimited! Use CLI instead. See warning above. Check service limits docs |
| REST API failures | REST API unreliable and misleading | Always use Azure CLI - See commands.md for complete CLI reference |
ExtensionNotFound | Quota extension not installed | az extension add --name quota |
BadRequest |
Known unsupported providers:
Confirmed working providers:
📖 See also: Troubleshooting Guide
| Resource | Link |
|---|---|
| CLI Commands Reference | commands.md - Complete syntax, parameters, examples |
| Azure Quotas Overview | Microsoft Learn |
| Service Limits Documentation | Azure subscription limits |
| Azure Portal - My Quotas | Portal Link |
| Request Quota Increases | How to request increases |
az quota list first - Discover correct quota resource names--output table for quick scanning┌─────────────────────────────────────────┐
│ 1. Install quota extension │
│ az extension add --name quota │
└─────────────────┬───────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ 2. Discover quota resource names │
│ az quota list --scope ... │
│ (Match by localizedValue) │
└─────────────────┬───────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ 3. Check current usage │
│ az quota usage show │
│ --resource-name <name> │
└─────────────────┬───────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ 4. Check quota limit │
│ az quota show │
│ --resource-name <name> │
└─────────────────┬───────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ 5. Validate capacity │
│ Available = Limit - (Usage + Need) │
└─────────────────┬───────────────────────┘
│
▼
┌────────┴────────┐
│ │
✅ Sufficient ❌ Insufficient
│ │
▼ ▼
Proceed Request increase
or change region
Weekly Installs
363
Repository
GitHub Stars
160
First Seen
Mar 10, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
github-copilot349
codex54
gemini-cli53
kimi-cli45
amp45
cline45
| commands.md |
| Azure Portal | My quotas - Use only as fallback |
| REST API | Microsoft.Quota provider - Unreliable, do NOT use first |
| Required Permission | Reader (view) or Quota Request Operator (manage) |
IPv4StandardSkuPublicIpAddresses| Resource provider not supported by quota API |
| Use CLI (preferred) or service limits docs |
MissingRegistration | Microsoft.Quota provider not registered | az provider register --namespace Microsoft.Quota |
QuotaExceeded | Deployment would exceed quota | Request increase or choose different region |
InvalidScope | Incorrect scope format | Use pattern: /subscriptions/<id>/providers/<namespace>/locations/<region> |