Skip to content

Commit 0df911b

Browse files
Merge pull request #116436 from tfitzmac/0526deploy
add note for deploy deletions
2 parents 2bd2460 + d8cd606 commit 0df911b

File tree

6 files changed

+183
-5
lines changed

6 files changed

+183
-5
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
title: Deployment history deletions
3+
description: Describes how Azure Resource Manager automatically deletes deployments from the deployment history. Deployments are deleted when the history is close to exceeding the limit of 800.
4+
ms.topic: conceptual
5+
ms.date: 05/27/2020
6+
---
7+
# Automatic deletions from deployment history
8+
9+
Every time you deploy a template, information about the deployment is written to the deployment history. Each resource group is limited to 800 deployments in its deployment history.
10+
11+
Starting in June 2020, Azure Resource Manager automatically deletes deployments from your history as you near the limit. Automatic deletion is a change from past behavior. Previously, you had to manually delete deployments from the deployment history to avoid getting an error.
12+
13+
> [!NOTE]
14+
> Deleting a deployment from the history doesn't affect any of the resources that were deployed.
15+
16+
## When deployments are deleted
17+
18+
Deployments are deleted from your deployment history only when you near the limit of 800. Azure Resource Manager deletes a small set of the oldest deployments to clear space for future deployments. Most of your history remains unchanged. The oldest deployments are always deleted first.
19+
20+
:::image type="content" border="false" source="./media/deployment-history-deletions/deployment-history.svg" alt-text="Deletions from deployment history":::
21+
22+
In addition to deployments, you also trigger deletions when you run the [what-if operation](template-deploy-what-if.md) or validate a deployment.
23+
24+
When you give a deployment the same name as one in the history, you reset its place in the history. The deployment moves to the most recent place in the history. You also reset a deployment's place when you [roll back to that deployment](rollback-on-error.md) after an error.
25+
26+
## Opt out of automatic deletions
27+
28+
You can opt out of automatic deletions from the history. **Use this option only when you want to manage the deployment history yourself.** The limit of 800 deployments in the history is still enforced. If you exceed 800 deployments, you'll receive an error and your deployment will fail.
29+
30+
To disable automatic deletions, register the `Microsoft.Resources/DisableDeploymentGrooming` feature flag. When you register the feature flag, you opt out of automatic deletions for the entire Azure subscription. You can't opt out for only a particular resource group.
31+
32+
# [PowerShell](#tab/azure-powershell)
33+
34+
For PowerShell, use [Register-AzProviderFeature](/powershell/module/az.resources/Register-AzProviderFeature).
35+
36+
```azurepowershell-interactive
37+
Register-AzProviderFeature -ProviderNamespace Microsoft.Resources -FeatureName DisableDeploymentGrooming
38+
```
39+
40+
To see the current status of your subscription, use:
41+
42+
```azurepowershell-interactive
43+
Get-AzProviderFeature -ProviderNamespace Microsoft.Resources -FeatureName DisableDeploymentGrooming
44+
```
45+
46+
# [Azure CLI](#tab/azure-cli)
47+
48+
For Azure CLI, use [az feature register](/cli/azure/feature#az-feature-register).
49+
50+
```azurecli-interactive
51+
az feature register --namespace Microsoft.Resources --name DisableDeploymentGrooming
52+
```
53+
54+
To see the current status of your subscription, use:
55+
56+
```azurecli-interactive
57+
az feature show --namespace Microsoft.Resources --name DisableDeploymentGrooming
58+
```
59+
60+
# [REST](#tab/rest)
61+
62+
For REST API, use [Features - Register](/rest/api/resources/features/register).
63+
64+
```rest
65+
POST https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/Microsoft.Resources/features/DisableDeploymentGrooming/register?api-version=2015-12-01
66+
```
67+
68+
To see the current status of your subscription, use:
69+
70+
```rest
71+
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/Microsoft.Resources/features/DisableDeploymentGrooming/register?api-version=2015-12-01
72+
```
73+
74+
---
75+
76+
## Next steps
77+
78+
* To learn about viewing the deployment history, see [View deployment history with Azure Resource Manager](deployment-history.md).

articles/azure-resource-manager/templates/deployment-history.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ title: Deployment history
33
description: Describes how to view Azure Resource Manager deployment operations with the portal, PowerShell, Azure CLI, and REST API.
44
tags: top-support-issue
55
ms.topic: conceptual
6-
ms.date: 05/22/2020
6+
ms.date: 05/26/2020
77
---
88
# View deployment history with Azure Resource Manager
99

10-
Azure Resource Manager enables you to view your deployment history and examine specific operations in past deployments. You can see the resources that were deployed, and get information about any errors.
10+
Azure Resource Manager enables you to view your deployment history. You can examine specific operations in past deployments and see which resources were deployed. This history contains information about any errors.
11+
12+
The deployment history for a resource group is limited to 800 deployments. As you near the limit, deployments are automatically deleted from the history. For more information, see [Automatic deletions from deployment history](deployment-history-deletions.md).
1113

1214
For help with resolving particular deployment errors, see [Resolve common errors when deploying resources to Azure with Azure Resource Manager](common-deployment-errors.md).
1315

@@ -111,7 +113,7 @@ Each deployment can include multiple operations. To see more details about a dep
111113

112114
1. On the summary for a deployment, select **Operation details**.
113115

114-
![Select deployment operations](./media/deployment-history/get-operation-details.png)
116+
![Select operation details](./media/deployment-history/get-operation-details.png)
115117

116118
1. You see the details for that step of the deployment. When an error occurs, the details include the error message.
117119

@@ -204,6 +206,6 @@ The response includes an error message.
204206
## Next steps
205207

206208
* For help with resolving particular deployment errors, see [Resolve common errors when deploying resources to Azure with Azure Resource Manager](common-deployment-errors.md).
207-
* To learn about using the activity logs to monitor other types of actions, see [View activity logs to manage Azure resources](../management/view-activity-logs.md).
209+
* To learn about how deployments are managed in the history, see [Automatic deletions from deployment history](deployment-history-deletions.md).
208210
* To validate your deployment before executing it, see [Deploy a resource group with Azure Resource Manager template](deploy-powershell.md).
209211

articles/azure-resource-manager/templates/deployment-quota-exceeded.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22
title: Deployment quota exceeded
33
description: Describes how to resolve the error of having more than 800 deployments in the resource group history.
44
ms.topic: troubleshooting
5-
ms.date: 10/04/2019
5+
ms.date: 05/26/2020
66
---
77

88
# Resolve error when deployment count exceeds 800
99

1010
Each resource group is limited to 800 deployments in its deployment history. This article describes the error you receive when a deployment fails because it would exceed the allowed 800 deployments. To resolve this error, delete deployments from the resource group history. Deleting a deployment from the history doesn't affect any of the resources that were deployed.
1111

12+
> [!NOTE]
13+
> Starting in June 2020, Azure Resource Manager automatically deletes deployments from your history as you near the limit. You may still see this error if you've opted out of automatic deletions. For more information, see [Automatic deletions from deployment history](deployment-history-deletions.md).
14+
1215
## Symptom
1316

1417
During deployment, you receive an error stating that the current deployment will exceed the quota of 800 deployments.
6.86 KB
Loading

0 commit comments

Comments
 (0)