解決資源配額的錯誤

本文說明在您使用 Azure Resource Manager 範本 (ARM 範本) 或 Bicep 檔案部署資源時可能會發生的資源配額錯誤。

徵兆

如果您的範本建立超過 Azure 配額的資源,則可能會發生下列錯誤:

Code=OperationNotAllowed
Message=Operation results in exceeding quota limits of Core.
Maximum allowed: 4, Current in use: 4, Additional requested: 2.

或者,您可能會看見此錯誤:

Code=ResourceQuotaExceeded
Message=Creating the resource of type <resource-type> would exceed the quota of <number>
resources of type <resource-type> per resource group. The current resource count is <number>,
please delete some resources of this type before creating a new one.

原因

配額在每個資源群組、訂用帳戶、帳戶和其他範圍套用。 例如,您的訂用帳戶可能已設訂為限制區域的 vCPU 數目。 如果您嘗試使用大於允許數目的 vCPU 部署虛擬機器,則將會收到超過配額的錯誤。

如需配額的詳細資訊,請參閱 Azure 訂用帳戶和服務限制、配額與條件約束

針對 Azure CLI,使用 az vm list-usage 命令以找出虛擬機器配額。

az vm list-usage --location "West US" --output table
Name                                      CurrentValue    Limit
----------------------------------------  --------------  -------
Availability Sets                         0               2500
Total Regional vCPUs                      0               100
Virtual Machines                          0               25000
Virtual Machine Scale Sets                0               2500
Dedicated vCPUs                           0               3000
Cloud Services                            0               2500
Total Regional Low-priority vCPUs         0               100
Standard BS Family vCPUs                  0               100
...

解決方案

若要要求增加配額,請移至入口網站並提出支援問題 在支援問題中,要求增加您欲部署的區域配額。

某些配額可讓您指定提交以供檢閱的配額限制,進而核准或拒絕。 如果您的限制遭到拒絕,您會看到開啟支援要求的連結。

注意

請記住,對於資源群組,配額適用於每個個別區域,而不是整個訂用帳戶。 如果您需要在美國西部部署 30 個 vCPUs,則必須要求在美國西部擁有 30 個 Resource Manager vCPU。 如果您需要在任何具有存取權限的區域中部署 30 個 vCPU,則應該要求在所有區域中擁有 30 個 Resource Manager vCPU。

  1. 登入 Azure 入口網站

  2. 在搜尋方塊中,輸入訂用帳戶。 或者,如果您最近曾檢視您的訂用帳戶,請選取 [訂用帳戶]

    Screenshot of the Azure portal with search box and Subscriptions highlighted.

  3. 選取您訂用帳戶的連結。

    Screenshot of the Azure portal subscriptions list, highlighting a specific subscription link.

  4. 選取 [使用量 + 配額]

    Screenshot of the subscription settings page, highlighting the 'Usage + quotas' option in the menu.

  5. 選取 [要求增加]。

    您也可以從配額清單提交配額增加的支援要求。 針對具有 [鉛筆] 圖示的配額,您可以指定配額限制。

    Screenshot of the 'Usage + quotas' page, showing the 'Request increase' button and a pencil icon indicating the option to specify a quota limit.

  6. 完成所需增加的配額類型的表單。

    Screenshot of the quota increase request form, displaying various fields for users to provide details about their desired quota increase.