Recently, I have faced an issue, where our CD pipeline start failing (in Dev Envrionment, few second back things were working fine).

We found that, there is no issue with code but it was due to resource deployment history quota against resoruce group.

Deployment histories are very important. They not only help to keep track of changes but also useful for audit and compliance purposes.

As per MS documentation, RG can only keep the history of the last 800 deployments. You can not deploy/re-deploy anything once the deployment history reaches 800.

Error

To solve this we need to use a simple but very useful PS


$resourceGroup = 'your-resource-group'`

Get-AzureRmResourceGroupDeployment -ResourceGroupName $resourceGroup `

| Select-Object -Skip 100 `

| Remove-AzureRmResourceGroupDeployment

skip will ensure to keep latest deployments (in this case latest 100).

This PS only delete the deployment history and does’t has any impact on deployment, they will remain untouched.

Related Posts

About Ajeet Chouksey

With a robust background spanning more than 18 years, I am an adept Azure and Azure DevOps architect and engineer, dedicated to crafting Azure-centric solutions that prioritize customer requirements and agile methodologies. My expertise encompasses steering extensive cloud migration initiatives and advocating for Azure best practices, all aimed at streamlining costs and steering multinational teams towards success. Fueled by a passion for technological innovation, I am committed to perpetual learning, constantly advancing my proficiency in Azure, AI, MLOps, and Product Management to stay at the forefront of the industry..