azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Get-AzureRmRecoveryServicesBackupItem for a Windows Server backup

Open ghost opened this issue 8 years ago • 13 comments

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

ghost avatar Mar 08 '18 04:03 ghost

@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)?

cormacpayne avatar Mar 08 '18 17:03 cormacpayne

Any movement or update please?

ghost avatar Jul 05 '18 20:07 ghost

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.

marknettle avatar Nov 23 '18 01:11 marknettle

Is there a resolution or workaround for this? Still cant use WindowsServer property

vaughngit avatar Mar 30 '19 02:03 vaughngit

Need to use Get-OBJob for getting azure backup information from onprem servers

rivir avatar Mar 30 '19 02:03 rivir

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

vaughngit avatar Mar 30 '19 03:03 vaughngit

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.

clebarge avatar Apr 03 '19 16:04 clebarge

I am also interested in this issue as I have the same problem.

irateadmin avatar Apr 30 '19 19:04 irateadmin

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 avatar May 21 '19 09:05 Aidenwebb

@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?

pvrk avatar May 27 '19 17:05 pvrk

#please-close Since we haven't received a response. Please feel free to re-open if there are more details or information.

pvrk avatar Jun 03 '19 17:06 pvrk

#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.

Aidenwebb avatar Jun 05 '19 15:06 Aidenwebb

Why was it closed with no resolution? It's impossible to manage MARS file/folder backups without this option and with PowerShell.

tech1982 avatar Jul 22 '19 14:07 tech1982