Set-AzureRmRecoveryServicesVaultContext is inconsistent with how other services are managed and is also missing a "Get-" partner
Cmdlet(s)
Set-AzureRmRecoveryServicesVaultContext
PowerShell Version
5.1.14409.1005
Module Version
AzureRM.RecoveryServices 2.6.0
OS Version
10.0.14409.1005
Description
The Set-AzureRMRecoveryServicesVaultContext command is inconsistent with other "Context" commands such as Azure Storage. This pattern doesn't seem to be consistent with most other Azure commands as well.
Also, there doesn't seem to be a corresponding "Get-" command to show what the current Context is.
Debug Output
N/A
Script/Steps for Reproduction
@pragrawa would you mind taking a look at this issue?
@MattAllison would you mind providing more details about the pattern you mentioned previously?
Sorry for the delay.
As I'm sure you know, current Azure Backup cmdlets work using a model similar to Set-AzureRMContext.
Backup is the only service that uses this model - all other Azure services work by passing a variable to set their scope. For example, Add-AzureRMNetworkInterface has a -VM parameter for the VM to interact with and Azure Storage commands use a Context object passed as a parameter.
IMO, having Backup not follow a similar model creates unnecessary challenges in learning and operations.
Also, in its current state, there isn't a "Get-AzureRMREcoveryServicesVaultContext" command so, even with the current model, there isn't a proper way to check what the current context is.
Does that help?
@dragonfly91 @viverm would you mind taking a look at this issue?
@dragonfly91 do you know why we have cmdlet SetAzureRmRecoveryServicesVaultContext and SetAzureRmRecoveryServicesBackupProperties in recoveryservices module.
In ASR we are not using them , if it is not needed in backup we can clean them up in upcoming breaking release.
We are planning to deprecate this command. We now have an option to provide vaultID as a parameter for any command. This lets you know for which vault this command is executed.
#please-close