You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/backup/backup-azure-delete-vault.md
+146-5Lines changed: 146 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ author: dcurwin
6
6
manager: carmonm
7
7
ms.service: backup
8
8
ms.topic: conceptual
9
-
ms.date: 07/29/2019
9
+
ms.date: 09/10/2019
10
10
ms.author: dacurwin
11
11
---
12
12
# Delete an Azure Backup Recovery Services vault
@@ -94,8 +94,6 @@ First, read the **[Before you start](#before-you-start)** section to understand
94
94
4. Select the consent check box, and then select **Delete**.
95
95
96
96
97
-
98
-
99
97
5. Check the **Notification** icon . After the operation finishes, the service displays the message: *Stopping backup and deleting backup data for "Backup Item."**Successfully completed the operation*.
100
98
6. Select **Refresh** on the **Backup Items** menu, to make sure the backup item is deleted.
101
99
@@ -170,6 +168,151 @@ After you delete the on-premises backup items, follow the next steps from the po
170
168
171
169
4. Select **Yes** to verify that you want to delete the vault. The vault is deleted. The portal returns to the **New** service menu.
172
170
171
+
## Delete the Recovery Services vault by using PowerShell
172
+
173
+
First, read the **[Before you start](#before-you-start)** section to understand the dependencies and vault deletion process.
174
+
175
+
To stop protection and delete the backup data:
176
+
177
+
- If you are using SQL in Azure VMs backup and enabled auto-protection for SQL instances, first disable the auto-protection.
178
+
179
+
```PowerShell
180
+
Disable-AzRecoveryServicesBackupAutoProtection
181
+
[-InputItem] <ProtectableItemBase>
182
+
[-BackupManagementType] <BackupManagementType>
183
+
[-WorkloadType] <WorkloadType>
184
+
[-PassThru]
185
+
[-VaultId <String>]
186
+
[-DefaultProfile <IAzureContextContainer>]
187
+
[-WhatIf]
188
+
[-Confirm]
189
+
[<CommonParameters>]
190
+
```
191
+
192
+
[Learn more](https://docs.microsoft.com/powershell/module/az.recoveryservices/disable-azrecoveryservicesbackupautoprotection?view=azps-2.6.0) on how to disable protection for an Azure Backup-protected item
193
+
194
+
- Stop protection and delete data for all backup-protected items in cloud (ex. laaS VM, Azure File Share etc.):
195
+
196
+
```PowerShell
197
+
Disable-AzRecoveryServicesBackupProtection
198
+
[-Item] <ItemBase>
199
+
[-RemoveRecoveryPoints]
200
+
[-Force]
201
+
[-VaultId <String>]
202
+
[-DefaultProfile <IAzureContextContainer>]
203
+
[-WhatIf]
204
+
[-Confirm]
205
+
[<CommonParameters>]
206
+
```
207
+
[Learn more](https://docs.microsoft.com/powershell/module/az.recoveryservices/disable-azrecoveryservicesbackupprotection?view=azps-2.6.0&viewFallbackFrom=azps-2.5.0) about disables protection for a Backup-protected item.
208
+
209
+
- For on-premises Files and Folders protected using Azure Backup Agent (MARS) backing up to Azure, use the following PowerShell command to delete the backed-up data from each MARS PowerShell module:
*Microsoft Azure Backup Are you sure you want to remove this backup policy? Deleted backup data will be retained for 14 days. After that time, backup data will be permanently deleted. <br/>
218
+
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):*
219
+
220
+
221
+
- For on-premises machines protected using MABS (Microsoft Azure Backup Server) or DPM to Azure (System Center Data Protection Manager), use the following command to delete the backed up data in Azure.
Are you sure you want to remove this backup policy? Deleted backup data will be retained for 14 days. After that time, backup data will be permanently deleted. <br/>
231
+
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):*
232
+
233
+
After deleting the backed up data, un-register any on-premises containers and management servers.
234
+
235
+
- For on-premises Files and Folders protected using Azure Backup Agent (MARS) backing up to Azure:
236
+
237
+
```PowerShell
238
+
Unregister-AzRecoveryServicesBackupContainer
239
+
[-Container] <ContainerBase>
240
+
[-PassThru]
241
+
[-VaultId <String>]
242
+
[-DefaultProfile <IAzureContextContainer>]
243
+
[-WhatIf]
244
+
[-Confirm]
245
+
[<CommonParameters>]
246
+
```
247
+
[Learn more](https://docs.microsoft.com/powershell/module/az.recoveryservices/unregister-azrecoveryservicesbackupcontainer?view=azps-2.6.0) about un-registering a Windows Server or other container from the vault.
248
+
249
+
- For on-premises machines protected using MABS (Microsoft Azure Backup Server) or DPM to Azure (System Center Data Protection Manage:
[Learn more](https://docs.microsoft.com/powershell/module/az.recoveryservices/unregister-azrecoveryservicesbackupcontainer?view=azps-2.6.0) about un-registering a Backup management container from the vault.
263
+
264
+
After permanently deleting backed up data and un-registering all containers, proceed to delete the vault.
265
+
266
+
To delete a Recovery Services vault:
267
+
268
+
```PowerShell
269
+
Remove-AzRecoveryServicesVault
270
+
-Vault <ARSVault>
271
+
[-DefaultProfile <IAzureContextContainer>]
272
+
[-WhatIf]
273
+
[-Confirm]
274
+
[<CommonParameters>]
275
+
```
276
+
277
+
[Learn more](https://docs.microsoft.com/powershell/module/az.recoveryservices/remove-azrecoveryservicesvault) about deleting a recovery services vault.
278
+
279
+
## Delete the Recovery Services vault by using CLI
280
+
281
+
First, read the **[Before you start](#before-you-start)** section to understand the dependencies and vault deletion process.
282
+
283
+
> [!NOTE]
284
+
> Currently, Azure Backup CLI supports managing only Azure VM backups, so the following command to delete the vault works only if the vault contains Azure VM backups. You cannot delete a vault using Azure Backup CLI, if the vault contains any backup item of type other than Azure VMs.
285
+
286
+
To delete existing Recovery services vault, perform the below:
287
+
288
+
- To stop protection and delete the backup data
289
+
290
+
```CLI
291
+
az backup protection disable --container-name
292
+
--item-name
293
+
[--delete-backup-data {false, true}]
294
+
[--ids]
295
+
[--resource-group]
296
+
[--subscription]
297
+
[--vault-name]
298
+
[--yes]
299
+
```
300
+
301
+
For more information, refer to this [article](https://docs.microsoft.com/cli/azure/backup/protection?view=azure-cli-latest#az-backup-protection-disable.).
302
+
303
+
- Delete an existing Recovery services vault:
304
+
305
+
```CLI
306
+
az backup vault delete [--force]
307
+
[--ids]
308
+
[--name]
309
+
[--resource-group]
310
+
[--subscription]
311
+
[--yes]
312
+
```
313
+
314
+
For more information, refer to this [article](https://docs.microsoft.com/cli/azure/backup/vault?view=azure-cli-latest)
315
+
173
316
## Delete the Recovery Services vault by using Azure Resource Manager
174
317
175
318
This option to delete the Recovery Services vault is recommended only if all of the dependencies are removed and you're still getting the *Vault deletion error*. Try any or all of the following tips:
@@ -178,8 +321,6 @@ This option to delete the Recovery Services vault is recommended only if all of
178
321
- Try [deleting the vault from the portal](#delete-the-recovery-services-vault) again.
179
322
- If all of the dependencies are removed and you're still getting the *Vault deletion error*, use the ARMClient tool to perform the following steps (after the note).
0 commit comments