Skip to content

Commit 95de3cb

Browse files
author
David Curwin
committed
Stop AFS backup in Powershell
1 parent 4a95ff7 commit 95de3cb

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

articles/backup/backup-azure-afs-automation.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,55 @@ $job.ErrorDetails
412412
1073871825 Microsoft Azure Backup encountered an internal error. Wait for a few minutes and then try the operation again. If the issue persists, please contact Microsoft support.
413413
```
414414

415+
## Manage Azure File Shares backup
416+
417+
### Stop Protection on a file share
418+
419+
There are two ways to stop protecting Azure file shares:
420+
421+
* Stop all future backup jobs and *delete* all recovery points
422+
* Stop all future backup jobs but *leave* the recovery points
423+
424+
There may be a cost associated with leaving the recovery points in storage, as the underlying snapshots created by Azure Backup will be retained. However, the benefit of leaving the recovery points is you can restore the file share later, if desired. For information about the cost of leaving the recovery points, see the [pricing details](https://azure.microsoft.com/pricing/details/storage/files/). If you choose to delete all recovery points, you can't restore the file share.
425+
426+
#### Stop Protection and retain recovery points
427+
428+
To stop protection while retaining data, use the [Disable-AzRecoveryServicesBackupProtection](https://docs.microsoft.com/powershell/module/az.recoveryservices/disable-azrecoveryservicesbackupprotection?view=azps-3.3.0) cmdlet.
429+
430+
The following example stops protection for the *afsfileshare* file share but retains all recovery points:
431+
432+
```powershell
433+
$vaultID = Get-AzRecoveryServicesVault -ResourceGroupName "afstesting" -Name "afstest" | select -ExpandProperty ID
434+
$bkpItem = Get-AzRecoveryServicesBackupItem -BackupManagementType AzureStorage -WorkloadType AzureFiles -Name "afsfileshare" -VaultId $vaultID
435+
Disable-AzRecoveryServicesBackupProtection -Item $bkpItem -VaultId $vaultID
436+
```
437+
438+
```output
439+
WorkloadName Operation Status StartTime EndTime JobID
440+
------------ --------- ------ --------- ------- -----
441+
afsfileshare DisableBackup Completed 1/26/2020 2:43:59 PM 1/26/2020 2:44:21 PM 98d9f8a1-54f2-4d85-8433-c32eafbd793f
442+
```
443+
444+
The Job ID attribute in the output corresponds to the Job ID of the job that is created by the backup service for your “stop protection” operation. To track the status of the job, use the [Get-AzRecoveryServicesBackupJob](https://docs.microsoft.com/powershell/module/az.recoveryservices/get-azrecoveryservicesbackupjob?view=azps-3.3.0) cmdlet.
445+
446+
#### Stop Protection without retaining recovery points
447+
448+
To stop protection without retaining recovery points, use the [Disable-AzRecoveryServicesBackupProtection]((https://docs.microsoft.com/powershell/module/az.recoveryservices/disable-azrecoveryservicesbackupprotection?view=azps-3.3.0) cmdlet and add the **-RemoveRecoveryPoints** parameter.
449+
450+
The following example stops protection for the *afsfileshare* file share without retaining recovery points:
451+
452+
```powershell
453+
$vaultID = Get-AzRecoveryServicesVault -ResourceGroupName "afstesting" -Name "afstest" | select -ExpandProperty ID
454+
$bkpItem = Get-AzRecoveryServicesBackupItem -BackupManagementType AzureStorage -WorkloadType AzureFiles -Name "afsfileshare" -VaultId $vaultID
455+
Disable-AzRecoveryServicesBackupProtection -Item $bkpItem -VaultId $vaultID -RemoveRecoveryPoints
456+
```
457+
458+
```output
459+
WorkloadName Operation Status StartTime EndTime JobID
460+
------------ --------- ------ --------- ------- -----
461+
afsfileshare DeleteBackupData Completed 1/26/2020 2:50:57 PM 1/26/2020 2:51:39 PM b1a61c0b-548a-4687-9d15-9db1cc5bcc85
462+
```
463+
415464
## Next steps
416465

417466
[Learn about](backup-afs.md) backing up Azure Files in the Azure portal.

0 commit comments

Comments
 (0)