Closed ArtemProc closed 5 years ago
@viverm Can you take a look at this issue? It looks like Get-AzureRmRecoveryServicesVault returns a ARSVault and Set-ASRVaultContext takes an ARSVault but they are actually different types.
Same Issue with Latest AzureRM.Profile and other updated
PS C:\WINDOWS\system32> Get-AzureRmRecoveryServicesVault -Name MY_VAULT-vault | set-AzureRmRecoveryServicesAsrVaultContext $vault = Get-AzureRmRecoveryServicesVault -Name MY_VAULT-vault Set-AzureRmRecoveryServicesAsrVaultSettings -Vault $vault set-AzureRmRecoveryServicesAsrVaultContext : The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties d o not match any of the parameters that take pipeline input. At line:1 char:57
+ CategoryInfo : InvalidArgument: (Microsoft.Azure...rvices.ARSVault:PSObject) [Set-AzureRmReco...AsrVaultContext], ParameterBindingException
+ FullyQualifiedErrorId : InputObjectNotBound,Microsoft.Azure.Commands.RecoveryServices.SiteRecovery.SetAzureRmRecoveryServicesAsrVaultSettings
Set-AzureRmRecoveryServicesAsrVaultContext : Cannot bind parameter 'Vault'. Cannot convert the "Microsoft.Azure.Commands.RecoveryServices.ARSVault" value of type "Microsoft.Azure.Commands.RecoveryServi ces.ARSVault" to type "Microsoft.Azure.Commands.RecoveryServices.ARSVault". At line:3 char:52
+ CategoryInfo : InvalidArgument: (:) [Set-AzureRmReco...AsrVaultContext], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.Azure.Commands.RecoveryServices.SiteRecovery.SetAzureRmRecoveryServicesAsrVaultSettings
PS C:\WINDOWS\system32> get-module -ListAvailable -Name "azure" | select Name, Version
Name Version
Azure 5.1.1
Azure.Storage 4.1.1
AzureRM.profile 4.3.1
AzureRM.RecoveryServices 4.0.2
AzureRM.RecoveryServices.SiteRecovery 0.2.1
AzureInformationProtection 1.21.203.0
PS C:\WINDOWS\system32>
you can unblock customer with
$path = Get-AzureRmRecoveryServicesVaultSettingsFile -Vault $Vault Import-AzureRmRecoveryServicesAsrVaultSettingsFile -Path $path.filepath
is equivalent to
Set-ASRVaultContext -Vault $vault
looking for exact issue.
Thank you for workaround. And should we expect fix for initial issue?
ASR module has been merged with RecoveryServices in Az module
Description
Issue with latest modules for Recovery Services
AzureRM.RecoveryServices 4.0.2 AzureRM.RecoveryServices.SiteRecovery 0.2.1
Mitigation
Name Version
AzureRM.profile 3.4.1 AzureRM.RecoveryServices 3.4.1 AzureRM.RecoveryServices.SiteRecovery 0.1.6
Script/Steps for Reproduction
Repro steps:
AzureRM.profile 4.3.0 AzureRM.RecoveryServices 4.0.2 AzureRM.RecoveryServices.SiteRecovery 0.2.1
Code is pretty simple:
Add-AzureRmAccount
$vault = Get-AzureRmRecoveryServicesVault -Name artempro-vault Set-ASRVaultContext -Vault $vault
Module Version
PS C:\WINDOWS\system32> Get-Module -ListAvailable -Name "azure" | Select Name, Version
Name Version
Azure 5.1.1 Azure.Storage 4.1.1 AzureRM.Compute 4.3.1 AzureRM.Insights 4.0.2 AzureRM.Network 5.1.1 AzureRM.OperationalInsights 4.2.0 AzureRM.profile 4.3.0 AzureRM.RecoveryServices 4.0.2 AzureRM.RecoveryServices.Backup 4.1.0 AzureRM.RecoveryServices.SiteRecovery 0.2.1 AzureInformationProtection 1.21.203.0