Skip to content

Commit 7b4123a

Browse files
committed
use tabs
1 parent 2f4d11e commit 7b4123a

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

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

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.custom: devx-track-azurecli, devx-track-arm-template
88

99
# Automatic deletions from deployment history
1010

11-
When you deploy resources to Azure, the deployment details are recorded in the deployment history at the scope where the deployment occurs. Each scopewhether it's a resource group, subscription, or management group—can store up to **800 deployments** in its history. Once this limit is reached, Azure **automatically deletes the oldest deployments** to make space for new ones. This automatic cleanup process has been in effect since **August 6, 2020**.
11+
When you deploy resources to Azure, the deployment details are recorded in the deployment history at the scope where the deployment occurs. Each scopewhether it's a resource group, subscription, or management group—can store up to **800 deployments** in its history. Once this limit is reached, Azure **automatically deletes the oldest deployments** to make space for new ones. This automatic cleanup process was implemented on **August 6, 2020**.
1212

1313
> [!NOTE]
1414
> Deleting a deployment from the history doesn't affect any of the resources that were deployed.
@@ -34,31 +34,43 @@ If the current user doesn't have the required permissions, automatic deletion is
3434

3535
## Removing locks that block deletions
3636

37-
If you have a [CanNotDelete lock](../management/lock-resources.md) on a resource group or a subscription, the deployments for that scope can't be automatically deleted. To enable automatic cleanup of the deployment history, you'll need to remove the lock.
37+
If you have a [CanNotDelete lock](../management/lock-resources.md) on a resource group or a subscription, the deployments for that scope can't be automatically deleted. To enable automatic cleanup of the deployment history, you need to remove the lock.
3838

39-
To delete a resource group lock using Azure PowerShell, run the following commands:
39+
To delete a resource group lock, run the following commands:
40+
41+
### [PowerShell](#tab/azure-powershell)
4042

4143
```azurepowershell-interactive
4244
$lockId = (Get-AzResourceLock -ResourceGroupName lockedRG).LockId
4345
Remove-AzResourceLock -LockId $lockId
4446
```
4547

46-
To delete a resource group lock using Azure CLI, run the following commands:
48+
To delete a resource group lock, run the following commands:
49+
50+
### [Azure CLI](#tab/azure-cli)
4751

4852
```azurecli-interactive
4953
lockid=$(az lock show --resource-group lockedRG --name deleteLock --output tsv --query id)
5054
az lock delete --ids $lockid
5155
```
5256

57+
### [REST](#tab/rest)
58+
59+
```rest
60+
DELETE https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}?api-version=2016-09-01
61+
```
62+
63+
---
64+
5365
## How to opt out of automatic deletions
5466

55-
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.
67+
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 receive an error and your deployment fail.
5668

5769
To disable automatic deletions at the tenant or the management group scope, open a support ticket. For the instructions, see [Request support](./overview.md#get-support).
5870

5971
To disable automatic deletions at the subscription scope, 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. To reenable automatic deletions, unregister the feature flag.
6072

61-
# [PowerShell](#tab/azure-powershell)
73+
### [PowerShell](#tab/azure-powershell)
6274

6375
For PowerShell, use [Register-AzProviderFeature](/powershell/module/az.resources/Register-AzProviderFeature).
6476

@@ -74,7 +86,7 @@ Get-AzProviderFeature -ProviderNamespace Microsoft.Resources -FeatureName Disabl
7486

7587
To reenable automatic deletions, use Azure REST API or Azure CLI.
7688

77-
# [Azure CLI](#tab/azure-cli)
89+
### [Azure CLI](#tab/azure-cli)
7890

7991
For Azure CLI, use [az feature register](/cli/azure/feature#az-feature-register).
8092

@@ -94,7 +106,7 @@ To reenable automatic deletions, use [az feature unregister](/cli/azure/feature#
94106
az feature unregister --namespace Microsoft.Resources --name DisableDeploymentGrooming
95107
```
96108

97-
# [REST](#tab/rest)
109+
### [REST](#tab/rest)
98110

99111
For REST API, use [Features - Register](/rest/api/resources/features/register).
100112

0 commit comments

Comments
 (0)