Get-AzureRmRecoveryServicesBackupItem for a Windows Server backup
Description
Get-AzureRmRecoveryServicesBackupItem -Container $Container expects a workloadtype of either AzureVM or AzureSQL. Windows is not a valid value for the parameter and neither of the two valid options work.
Help also indicated there should be a Windows or a WindowsServer value:
WorkloadType: !? Workload type of the resource (for example: AzureVM, WindowsServer).
Script/Steps for Reproduction
PS C:\> Get-AzureRmRecoveryServicesBackupItem -Container $container
cmdlet Get-AzureRmRecoveryServicesBackupItem at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
WorkloadType: !?
Workload type of the resource (for example: AzureVM, WindowsServer).
WorkloadType: WindowsServer
Get-AzureRmRecoveryServicesBackupItem : Cannot bind parameter 'WorkloadType'. Cannot convert value "WindowsServer" to type
"Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models.WorkloadType". Error: "Unable to match the identifier name WindowsServer
to a valid enumerator name. Specify one of the following enumerator names and try again:
AzureVM, AzureSQLDatabase"
At line:1 char:1
+ Get-AzureRmRecoveryServicesBackupItem -Container $container
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-AzureRmRecoveryServicesBackupItem], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.GetAzureRmRecoverySe
rvicesBackupItem
Module Version
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 4.1.1 AzureRM.Profile {Add-AzureRmAccount, Add-AzureRmEnvironment, Clear-AzureRmContext, Clear-Azure...
Script 4.0.1 AzureRM.RecoveryServices {Get-AzureRmRecoveryServicesBackupProperty, Get-AzureRmRecoveryServicesVault, ...
Script 4.0.3 AzureRM.RecoveryServices.Backup {Backup-AzureRmRecoveryServicesBackupItem, Disable-AzureRmRecoveryServicesBack...
Script 0.2.1 AzureRM.RecoveryServices.SiteRec... {Edit-AzureRmRecoveryServicesAsrRecoveryPlan, Get-AzureRmRecoveryServicesAsrAl...
Environment Data
Name Value
---- -----
PSVersion 5.1.16299.248
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.16299.248
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
@CodeHeadTheo it looks like there is a misunderstanding with how PowerShell scrapes the help content -- the markdown help file for this cmdlet accurately describes the values you can provide for the parameter, and will show you this when running Get-Help Get-AzureRmRecoveryServicesBackupItem
However, the HelpMessage for this parameter in the C# code points to the text that you are seeing, and will show you this when asking for the description of a parameter with !?.
The markdown help file is the documentation that we maintain, and we weren't aware that this method of getting the description for a parameter was pointing at a different text.
@dragonfly91 would you mind taking a look at this issue and updating the appropriate help message string for this cmdlet (and possibly anywhere else that you find incorrect documentation)?
Any movement or update please?
I am experiencing this with the latest modules.
AzureRM.profile 5.8.2
AzureRM.RecoveryServices 4.1.9
AzureRM.RecoveryServices.Backup 4.5.2
Get-AzureRmRecoveryServicesBackupItem -BackupManagementType MARS
cmdlet Get-AzureRmRecoveryServicesBackupItem at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
WorkloadType: !?
Workload type of the resource (for example: AzureVM, WindowsServer, AzureFiles).
WorkloadType: WindowsServer
Get-AzureRmRecoveryServicesBackupItem : Cannot bind parameter 'WorkloadType'. Cannot convert value "WindowsServer" to type
"Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models.WorkloadType". Error: "Unable to match the identifier name WindowsServer to a valid enumerator
name. Specify one of the following enumerator names and try again:
AzureVM, AzureSQLDatabase, AzureFiles"
The markdown help and the error message specify (AzureVM, AzureSQLDatabase ,AzureFiles) The ?! help specifies (AzureVM, WindowsServer, AzureFiles) None of these work.
Is there a resolution or workaround for this? Still cant use WindowsServer property
Need to use Get-OBJob for getting azure backup information from onprem servers
These servers no longer exist onprem. I am not sure I understand how the Get-OBJOb command fits within the context of the Azure powershell model? If it does please provide an example of such, and in particular how it provides a solution to set Get-AzureRmRecoveryServicesBackupItem when the workloadtype is the WindowsServer option
Hello, this issue appears to effect the new AZ.recoveryservices module as well. I've tested with the 1.1 and 1.2 versions of those modules.
I am also interested in this issue as I have the same problem.
I'm having this issue with Get-AzRecoveryServicesBackupItem. This issue is also listed here
Documentation for the Workload type is inconsistent with 3 values listed as bullet points and then the same 3 + MSSQL listed in the Accepted values table.
The module itself shows a different set of values Workload type of the resource (for example: AzureVM, WindowsServer, AzureFiles, MSSQL).
Intellisense lists: AzureFiles, AzureSQLDatabase, AzureVM, MSSQL
Example below - all containers in the list have a ContainerType of Windows and a BackupManagementType of MARS
PS C:\Users\[Redacted]> foreach ($backupContainer in $backupContainers){Get-AzRecoveryServicesBackupItem -VaultId $recoveryVault.ID -Container $backupContainer }
cmdlet Get-AzRecoveryServicesBackupItem at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
WorkloadType: AzureVM
Get-AzRecoveryServicesBackupItem : BackupManagementType is not expected for WorkloadType: AzureVM
At line:1 char:49
+ ... Containers){Get-AzRecoveryServicesBackupItem -VaultId $recoveryVault. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-AzRecoveryServicesBackupItem], ArgumentException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.GetAzureRmRecoveryServicesBackupItem
cmdlet Get-AzRecoveryServicesBackupItem at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
WorkloadType: WindowsServer
Get-AzRecoveryServicesBackupItem : Cannot bind parameter 'WorkloadType'. Cannot convert value "WindowsServer" to type
"Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models.WorkloadType". Error: "Unable to match the identifier name WindowsServer
to a valid enumerator name. Specify one of the following enumerator names and try again:
AzureVM, AzureSQLDatabase, AzureFiles, MSSQL"
At line:1 char:49
+ ... Containers){Get-AzRecoveryServicesBackupItem -VaultId $recoveryVault. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-AzRecoveryServicesBackupItem], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.GetAzureRmRecoverySer
vicesBackupItem
cmdlet Get-AzRecoveryServicesBackupItem at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
WorkloadType: AzureFiles
Get-AzRecoveryServicesBackupItem : BackupManagementType is not expected for WorkloadType: AzureFiles
At line:1 char:49
+ ... Containers){Get-AzRecoveryServicesBackupItem -VaultId $recoveryVault. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-AzRecoveryServicesBackupItem], ArgumentException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.GetAzureRmRecoveryServicesBackupItem
cmdlet Get-AzRecoveryServicesBackupItem at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
WorkloadType: MSSQL
Get-AzRecoveryServicesBackupItem : BackupManagementType is not expected for WorkloadType: MSSQL
At line:1 char:49
+ ... Containers){Get-AzRecoveryServicesBackupItem -VaultId $recoveryVault. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-AzRecoveryServicesBackupItem], ArgumentException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.GetAzureRmRecoveryServicesBackupItem
cmdlet Get-AzRecoveryServicesBackupItem at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
WorkloadType: AzureSQLDatabase
Get-AzRecoveryServicesBackupItem : BackupManagementType is not expected for WorkloadType: AzureSQLDatabase
At line:1 char:49
+ ... Containers){Get-AzRecoveryServicesBackupItem -VaultId $recoveryVault. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-AzRecoveryServicesBackupItem], ArgumentException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.GetAzureRmRecoveryServicesBackupItem
cmdlet Get-AzRecoveryServicesBackupItem at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
WorkloadType:
PS C:\Users\[Redacted]> $backupContainers.Length
45
PS C:\Users\[Redacted]> $backupContainers
FriendlyName ContainerType BackupManagementType
------------ ------------- --------------------
[Redacted name] Windows MARS
[Redacted name] Windows MARS
[Redacted name] Windows MARS
etc
Get-Module -Name Az
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 2.0.0 Az
$PSVersionTable
Name Value
---- -----
PSVersion 5.1.16299.1004
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.16299.1004
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
@Aidenwebb: While we will definitely concentrate on the cleanup, I just want to ask more on the requirement here. Azure PS module was built for handling Azure resources (Azure VM backup, Azure File Share, Azure workloads such as SQL). The on-premises components such as MAB agent, MAB server get shipped with their PS module and hence we assume users will use those for handling MAB agents. The backup item data from MAB Agent does get synced but there are no further actions possible like adhoc backup, restore, deleting backup data etc. So, can you please let us know what is the ultimate use of these items being retrieved using Azure PS module? Just for information from one single place?
#please-close Since we haven't received a response. Please feel free to re-open if there are more details or information.
#please-close Since we haven't received a response. Please feel free to re-open if there are more details or information.
@Aidenwebb: While we will definitely concentrate on the cleanup, I just want to ask more on the requirement here. Azure PS module was built for handling Azure resources (Azure VM backup, Azure File Share, Azure workloads such as SQL). The on-premises components such as MAB agent, MAB server get shipped with their PS module and hence we assume users will use those for handling MAB agents. The backup item data from MAB Agent does get synced but there are no further actions possible like adhoc backup, restore, deleting backup data etc. So, can you please let us know what is the ultimate use of these items being retrieved using Azure PS module? Just for information from one single place?
Hi Pvrk,
The main use here is in automating a restore from a MARS backup hosted in Azure. At present, in order to restore a file we need to log in to Azure portal, find the device and browse the files. This isn't viable in terms of automated disaster recovery, or scalable in terms of testing backups are accessible, readable, and useable.
My expectation is that as the MARS backup is being hosted in an Azure Vault, I could query and access that data in the vault via Azure Powershell, this however is not the case.
Why was it closed with no resolution? It's impossible to manage MARS file/folder backups without this option and with PowerShell.