This article describes how to use Azure PowerShell to manage and monitor the Azure file shares that are backed up by the Azure Backup service.
Warning
Make sure the PowerShell version is upgraded to the minimum version for 'Az.RecoveryServices 2.6.0' for AFS backups. For more details, refer to the section outlining the requirement for this change.
Modify the protection policy
To change the policy used for backing up the Azure file share, use Enable-AzRecoveryServicesBackupProtection. Specify the relevant backup item and the new backup policy.
The following example changes the testAzureFS protection policy from dailyafs to monthlyafs.
$job = Get-AzRecoveryServicesBackupJob -JobId 00000000-6c46-496e-980a-3740ccb2ad75 -VaultId $vaultID
$job | fl
IsCancellable : False
IsRetriable : False
ErrorDetails : {Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models.AzureFileShareJobErrorInfo}
ActivityId : 00000000-5b71-4d73-9465-8a4a91f13a36
JobId : 00000000-6c46-496e-980a-3740ccb2ad75
Operation : Restore
Status : Failed
WorkloadName : testAFS
StartTime : 12/10/2018 9:56:38 AM
EndTime : 12/10/2018 11:03:03 AM
Duration : 01:06:24.4660027
BackupManagementType : AzureStorage
$job.ErrorDetails
ErrorCode ErrorMessage Recommendations
--------- ------------ ---------------
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.
Stop protection on a file share
There are two ways to stop protecting Azure file shares:
Stop all future backup jobs and delete all recovery points
Stop all future backup jobs but leave the recovery points
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. If you choose to delete all recovery points, you can't restore the file share.
The Job ID attribute in the output corresponds to the Job ID of the job that's created by the backup service for your “stop protection” operation. To track the status of the job, use the Get-AzRecoveryServicesBackupJob cmdlet.
Learn about Azure Backup before learning to implement Recovery Vaults and Azure Backup Policies. Learn to implement Windows IaaS VM recovery, perform backup and restore of on-premises workloads, and manage Azure VM backups.