"DeploymentQuotaExceeded" error in Resource Group, but automatic rotation is not disabled

Donnie Wu 40 信譽點數
2026-06-22T07:24:16.9266667+00:00

Hello Azure Support Team,

I am currently unable to deploy resources to one of my Resource Groups due to a "DeploymentQuotaExceeded" error. The error indicates that the deployment limit of 800 has been reached, which I have verified in the Azure Portal.

According to Microsoft documentation regarding deployment history deletions, Azure should automatically rotate and delete older deployments to make room for new ones, preventing this limit from being reached.

I have already performed the following troubleshooting steps to rule out common causes for automatic deletion failures:

  1. Checked for Locks: I verified that there are no CanNotDelete locks applied to the Resource Group.

Checked Grooming Feature Flag: I verified that deployment grooming has not been disabled. Running az feature show --namespace Microsoft.Resources --name DisableDeploymentGrooming --query "properties.state" -o tsv confirms that this feature is not restricting the rotation.

Despite confirming the above, the automated rotation is not occurring. Additionally, I have noticed that another one of my Resource Groups is currently sitting at 750 deployments and is on the verge of hitting the exact same limit.

Could you please assist with the following:

Is there an undocumented reason or edge case why this automatic rotation is failing?

What steps must be taken to ensure that the deployment history automatically rotates as expected moving forward?

Azure 虛擬機器
Azure 虛擬機器

用來佈建 Windows 和 Linux 虛擬機器的 Azure 服務。


1 個回答

排序依據: 最實用
  1. Lakshma Reddy Vattijonnala 1,660 信譽點數 Microsoft 外部員工 仲裁者
    2026-07-06T08:26:05.09+00:00

    Hi @Donnie Wu Since you already confirmed there is no resource group lock and deployment grooming is not disabled, please verify that the identity performing the deployment has the Microsoft.Resources/deployments/delete permission. Azure performs automatic cleanup under the deploying user or service principal identity, and if that identity lacks this permission, older deployments are not deleted automatically.

    Also check for any CanNotDelete lock at the subscription scope, and consider whether many concurrent deployments are occurring, as Microsoft documentation notes that automatic deletion may not complete quickly enough when many deployments run at the same time.

    To unblock the resource group manually delete older deployment history entries:

    Azure CLI

    Use the az deployment group delete command to delete deployments from the history.

    az deployment group delete --resource-group exampleGroup --name deploymentName
    

    To delete all deployments older than five days, use:

    startdate=$(date +%F -d "-5days")
    deployments=$(az deployment group list --resource-group exampleGroup --query "[?properties.timestamp<'$startdate'].name" --output tsv)
    
    for deployment in $deployments
    do
      az deployment group delete --resource-group exampleGroup --name $deployment
    done
    
    

    You can get the current count in the deployment history with the following command. This example requires a Bash environment.

    az deployment group list --resource-group exampleGroup --query "length(@)"
    

    Azure PowerShell:

    Use the Remove-AzResourceGroupDeployment command to delete deployments from the history.

    Remove-AzResourceGroupDeployment -ResourceGroupName exampleGroup -Name deploymentName
    

    To delete all deployments older than five days, use:

    $deployments = Get-AzResourceGroupDeployment -ResourceGroupName exampleGroup | Where-Object -Property Timestamp -LT -Value ((Get-Date).AddDays(-5))
    
    foreach ($deployment in $deployments) {
      Remove-AzResourceGroupDeployment -ResourceGroupName exampleGroup -Name $deployment.DeploymentName
    }
    

    You can get the current count in the deployment history with the following command:

    (Get-AzResourceGroupDeployment -ResourceGroupName exampleGroup).Count
    

    Please refer the documents:

    Automatic deletions from deployment history
    Resolve error when deployment count exceeds 800.

    After you have completed the steps above, if the issue still persists, please send us the details requested in a private message so we can look into it further.

    If you have further questions regarding this answer, feel free to click "Comment". If you find the answer helpful, please click "upvote". This helps the community by allowing others with similar queries to easily find the solution.

    此回答有幫助嗎?

    有 1 人認為此回答有所幫助。
    0 則留言 沒有留言

您的回答

答案可由問題作者標示為「已接受」,而由仲裁者標示為「推薦」,這可協助使用者知道答案解決了作者的問題。