Skip to content

Commit 10b8942

Browse files
authored
Merge pull request #103663 from pvrk/Jan2020Local
Breaking change to PS AFS due to GA release
2 parents 2b37b24 + 33311e6 commit 10b8942

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed

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

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ Set up PowerShell as follows:
4040

4141
1. [Download the latest version of Az PowerShell](/powershell/azure/install-az-ps). The minimum version required is 1.0.0.
4242

43+
> [!WARNING]
44+
> The minimum version of PS required for preview was 'Az 1.0.0'. Due to upcoming changes for GA, the minimum PS version required will be 'Az.RecoveryServices 2.6.0'. It is very important to upgrade all existing PS versions to this version. Otherwise, the existing scripts will break after GA. Install the minimum version with the following PS commands
45+
46+
```powershell
47+
Install-module -Name Az.RecoveryServices -RequiredVersion 2.6.0
48+
```
49+
4350
2. Find the Azure Backup PowerShell cmdlets with this command:
4451

4552
```powershell
@@ -236,19 +243,32 @@ WorkloadName Operation Status StartTime
236243
testAzureFS ConfigureBackup Completed 11/12/2018 2:15:26 PM 11/12/2018 2:16:11 PM ec7d4f1d-40bd-46a4-9edb-3193c41f6bf6
237244
```
238245

246+
## Important notice - Backup item identification for AFS backups
247+
248+
This section outlines the changes in the Backup item retrieval for AFS backups from preview to GA.
249+
250+
While enabling the backup for AFS, user supplies the customer friendly File share name as the entity name and a backup item is created. The backup item's 'name' is a unique identifier created by Azure Backup service. Usually the identifier involves user friendly name. But there has been a change in the way Azure services internally identify an azure file share uniquely. This means that the unique-name of the backup item for AFS backup will be a GUID and will not have any relation to the customer friendly name. In order to know the unique name of each item, just run the ```Get-AzRecoveryServicesBackupItem``` command with the relevant filters for backupManagementType and WorkloadType to get all the relevant items and then observe the name field in the returned PS object/response. It is always recommended to list items and then retrieve their unique name from 'name' field in response. Use this value to filter the items with the 'Name' parameter. Otherwise use the FriendlyName parameter to retrieve the item with it's customer friendly name/identifier.
251+
252+
> [!WARNING]
253+
> Make sure the PS version is upgraded to the minimum version for 'Az.RecoveryServices 2.6.0' for AFS backups. With this version, the 'friendlyName' filter is available for ```Get-AzRecoveryServicesBackupItem``` command. Pass the azure file share name to friendlyName parameter. If you pass the azure file share name to the 'Name' parameter, this version throws a warning to pass this friendly name to the friendly name parameter. Not installing this minimum version might result in failure of existing scripts. Install the minimum version of PS with the following command.
254+
255+
```powershell
256+
Install-module -Name Az.RecoveryServices -RequiredVersion 2.6.0
257+
```
258+
239259
## Trigger an on-demand backup
240260

241261
Use [Backup-AzRecoveryServicesBackupItem](https://docs.microsoft.com/powershell/module/az.recoveryservices/backup-azrecoveryservicesbackupitem?view=azps-1.4.0) to run an on-demand backup for a protected Azure file share.
242262

243-
1. Retrieve the storage account and file share from the container in the vault that holds your backup data with [Get-AzRecoveryServicesBackupContainer](/powershell/module/az.recoveryservices/get-Azrecoveryservicesbackupcontainer).
244-
2. To start a backup job, you obtain information about the VM with [Get-AzRecoveryServicesBackupItem](/powershell/module/az.recoveryservices/Get-AzRecoveryServicesBackupItem).
263+
1. Retrieve the storage account from the container in the vault that holds your backup data with [Get-AzRecoveryServicesBackupContainer](/powershell/module/az.recoveryservices/get-Azrecoveryservicesbackupcontainer).
264+
2. To start a backup job, you obtain information about the Azure file share with [Get-AzRecoveryServicesBackupItem](/powershell/module/az.recoveryservices/Get-AzRecoveryServicesBackupItem).
245265
3. Run an on-demand backup with[Backup-AzRecoveryServicesBackupItem](/powershell/module/az.recoveryservices/backup-Azrecoveryservicesbackupitem).
246266

247267
Run the on-demand backup as follows:
248268

249269
```powershell
250270
$afsContainer = Get-AzRecoveryServicesBackupContainer -FriendlyName "testStorageAcct" -ContainerType AzureStorage
251-
$afsBkpItem = Get-AzRecoveryServicesBackupItem -Container $afsContainer -WorkloadType "AzureFiles" -Name "testAzureFS"
271+
$afsBkpItem = Get-AzRecoveryServicesBackupItem -Container $afsContainer -WorkloadType "AzureFiles" -FriendlyName "testAzureFS"
252272
$job = Backup-AzRecoveryServicesBackupItem -Item $afsBkpItem
253273
```
254274

@@ -268,6 +288,9 @@ On-demand backups can be used to retain your snapshots for 10 years. Schedulers
268288

269289
If you are looking for sample scripts, you can refer to the sample script on GitHub (<https://github.com/Azure-Samples/Use-PowerShell-for-long-term-retention-of-Azure-Files-Backup>) using Azure Automation runbook that enables you to schedule backups on a periodic basis and retain them even up to 10 years.
270290

291+
> [!WARNING]
292+
> Make sure the PS version is upgraded to the minimum version for 'Az.RecoveryServices 2.6.0' for AFS backups in your automation runbooks. You will have to replace the old 'AzureRM' module with 'Az' module. With this version, the 'friendlyName' filter is available for ```Get-AzRecoveryServicesBackupItem``` command. Pass the azure file share name to friendlyName parameter. If you pass the azure file share name to the 'Name' parameter, this version throws a warning to pass this friendly name to the friendly name parameter.
293+
271294
## Next steps
272295

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

articles/backup/manage-afs-powershell.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ ms.date: 1/27/2020
99

1010
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.
1111

12+
> [!WARNING]
13+
> Make sure the PS version is upgraded to the minimum version for 'Az.RecoveryServices 2.6.0' for AFS backups. For more details, refer to [the section](backup-azure-afs-automation.md#important-notice---backup-item-identification-for-afs-backups) outlining the requirement for this change.
14+
1215
## Modify the protection policy
1316

1417
To change the policy used for backing up the Azure file share, use [Enable-AzRecoveryServicesBackupProtection](https://docs.microsoft.com/powershell/module/az.recoveryservices/enable-azrecoveryservicesbackupprotection?view=azps-1.4.0). Specify the relevant backup item and the new backup policy.

articles/backup/restore-afs-powershell.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ This article explains how to restore an entire file share, or specific files, fr
1111

1212
You can restore an entire file share or specific files on the share. You can restore to the original location, or to an alternate location.
1313

14+
> [!WARNING]
15+
> Make sure the PS version is upgraded to the minimum version for 'Az.RecoveryServices 2.6.0' for AFS backups. For more details, refer to [the section](backup-azure-afs-automation.md#important-notice---backup-item-identification-for-afs-backups) outlining the requirement for this change.
16+
1417
## Fetch recovery points
1518

1619
Use [Get-AzRecoveryServicesBackupRecoveryPoint](https://docs.microsoft.com/powershell/module/az.recoveryservices/get-azrecoveryservicesbackuprecoverypoint?view=azps-1.4.0) to list all recovery points for the backed-up item.

0 commit comments

Comments
 (0)