Skip to content

Commit 9058f52

Browse files
Merge pull request #277770 from normesta/normesta-reg-updates-14
Adding template steps for soft delete
2 parents f4b04da + 7c4aa5b commit 9058f52

File tree

1 file changed

+71
-1
lines changed

1 file changed

+71
-1
lines changed

articles/storage/blobs/soft-delete-blob-enable.md

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: normesta
66

77
ms.service: azure-blob-storage
88
ms.topic: how-to
9-
ms.date: 07/21/2022
9+
ms.date: 06/10/2024
1010
ms.author: normesta
1111
ms.custom: devx-track-azurepowershell
1212
---
@@ -80,6 +80,41 @@ az storage account blob-service-properties show --account-name <storage-account>
8080
--resource-group <resource-group>
8181
```
8282

83+
### [Template](#tab/template)
84+
85+
To enable blob soft delete with an Azure Resource Manager template, create a template that sets the **deleteRetentionPolicy** property. The following steps describe how to create a template in the Azure portal.
86+
87+
1. In the Azure portal, choose **Create a resource**.
88+
1. In **Search the Marketplace**, type **Deploy a custom template**, and then press **ENTER**.
89+
1. Choose **Build your own template in the editor**.
90+
1. In the template editor, paste in the following JSON. Replace the `<account-name>` placeholder with the name of your storage account.
91+
92+
```json
93+
{
94+
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
95+
"contentVersion": "1.0.0.0",
96+
"parameters": {},
97+
"variables": {},
98+
"resources": [
99+
{
100+
"type": "Microsoft.Storage/storageAccounts/blobServices",
101+
"apiVersion": "2023-04-01",
102+
"name": "<account-name>/default",
103+
"properties": {
104+
"deleteRetentionPolicy": {
105+
"enabled": true,
106+
"days": 7
107+
}
108+
}
109+
}
110+
]
111+
}
112+
```
113+
114+
1. Specify the retention period. The default value is 7.
115+
1. Save the template.
116+
1. Specify the resource group of the account, and then choose the **Review + create** button to deploy the template and enable container soft delete.
117+
83118
---
84119

85120
## Enable blob soft delete (hierarchical namespace)
@@ -168,6 +203,41 @@ To enable blob soft delete for your storage account by using the Azure portal, f
168203
az storage fs service-properties update --delete-retention false --connection-string $con
169204
```
170205

206+
### [Template](#tab/template)
207+
208+
To enable blob soft delete with an Azure Resource Manager template, create a template that sets the **deleteRetentionPolicy** property. The following steps describe how to create a template in the Azure portal.
209+
210+
1. In the Azure portal, choose **Create a resource**.
211+
1. In **Search the Marketplace**, type **Deploy a custom template**, and then press **ENTER**.
212+
1. Choose **Build your own template in the editor**.
213+
1. In the template editor, paste in the following JSON. Replace the `<account-name>` placeholder with the name of your storage account.
214+
215+
```json
216+
{
217+
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
218+
"contentVersion": "1.0.0.0",
219+
"parameters": {},
220+
"variables": {},
221+
"resources": [
222+
{
223+
"type": "Microsoft.Storage/storageAccounts/blobServices",
224+
"apiVersion": "2023-04-01",
225+
"name": "<account-name>/default",
226+
"properties": {
227+
"deleteRetentionPolicy": {
228+
"enabled": true,
229+
"days": 7
230+
}
231+
}
232+
}
233+
]
234+
}
235+
```
236+
237+
1. Specify the retention period. The default value is 7.
238+
1. Save the template.
239+
1. Specify the resource group of the account, and then choose the **Review + create** button to deploy the template and enable container soft delete.
240+
171241
---
172242

173243
## Next steps

0 commit comments

Comments
 (0)