Manage Resource Group Deployment History
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

Ajeet Chouksey
- Getting the Most from GitHub Copilot and AI Models - Boost Productivity While Managing Costs
- The Evolving Role of the Product Owner in the Age of AI
- Supercharging Code Reviews with AI for Strategic Impact
- Branch Protection as Code Enforce GitHub Security at Scale
- Governance Layer Best Practices in GitHub
- Deploy and Configure SonarQube
- Azure Bastion
- DevOps Attitude