Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Wiki] Re-apply suggested changes #2383

Merged
merged 1 commit into from
Nov 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/wiki/The CI environment - Deployment history cleanup.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
This pipeline and its scripts can be used to limit the number of deployments that are listed in Azure at any given time. This is especially useful for a scope like 'Management Group' is Azure does not provide any [automatic cleanup](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/deployment-history-deletions?tabs=azure-powershell).
This pipeline and its scripts can be used to limit the number of deployments that are listed in the Azure deployments history at any given time. This is especially useful for a scope like 'Management Group', since for that scope, Azure Resource Manager does not currently provide [automatic deletion](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/deployment-history-deletions?tabs=azure-powershell) of deployments from your history as you near the 800 limit.

The corresponding error message would look similar to `Creating the deployment '<deploymentName>' would exceed the quota of '800'. The current deployment count is '804'. Please delete some deployments before creating a new one, or see https://aka.ms/800LimitFix for information on managing deployment limits.`
Without automatic deletion, if the scope you are deploying to is already at the 800 limit, your next deployment fails with an error. The corresponding error message would look similar to `Creating the deployment '<deploymentName>' would exceed the quota of '800'. The current deployment count is '804'. Please delete some deployments before creating a new one, or see https://aka.ms/800LimitFix for information on managing deployment limits.`

The platform pipeline `platform.deployment.removal.yml` has an automatic schedule that runs every night, but can also be triggered on-demand.

Expand Down Expand Up @@ -36,13 +36,13 @@ Both scripts work in the same way:
- 120 successful deployments
- 10 failed deployments that are 3 weeks old
- 10 failed deployments that are 1 week old
- 10 running
1. By default it then filters them down to non-running & non-failing deployments (can be modified). It only considers failed deployments if they are older than a provided time limit in which case they are included too.
- Following the example, and with a time limit of 2 weeks, it now only considers the
- 10 running deployments
1. By default, it then filters them down to non-running & non-failing deployments (can be modified). It only considers failed deployments for deletion if they are older than a provided time limit.
- Following the example, and with a `maxDeploymentRetentionInDays` of 14 days (2 weeks), the following deployments are targeted for deletion from the deployment history:
- 120 successful deployments
- 10 failed deployments that are 3 weeks old
1. Lastly, it removes all matching deployments in chunks of 100 deployments each.
- In context of the example, this mean it deletes the deployments with to commands, first removing 100, and then 30 deployments.
- In the context of the example, this means the procedure deletes the deployments in 2 chunks, first removing 100, and then 30 deployments.

# How to use it

Expand Down