Disable ASR (PowerShell)

Cloud Kid 1 Reputation point
2020-11-10T10:48:21.34+00:00

I have followed the Microsoft tech docs below but the command throws out an error:

Tech Docs:

https://video2.skills-academy.com/en-us/azure/backup/backup-azure-security-feature-cloud#:\~:text=Disabling%...

Error:

Powershell
Set-AzRecoveryServicesVaultProperty : Invalid format of the resource identifier.
Parameter name: idFromServer
At line:1 char:1

  • Set-AzRecoveryServicesVaultProperty -Vault $status -SoftDeleteFeature ...
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : CloseError: (:) [Set-AzRecoveryServicesVaultProperty], ArgumentException
  • FullyQualifiedErrorId : Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.SetAzureRmRecoveryServicesVaultProperty

I am not sure what the correct 'Identifier' is. According to the docs, it should be the vaultID but that does not work. I have also tried the vault name but that also throws back the same error.

I have also tried running the command on it's own in a single subscription with 1 ASR. The only paramerer requested is the Disable/Enable but when I type DIsable, it throws the following:

Powershell
PS C:\Users\CloudKid> Set-AzRecoveryServicesVaultProperty
cmdlet Set-AzRecoveryServicesVaultProperty at command pipeline position 1
Supply values for the following parameters:
SoftDeleteFeatureState: disable
Set-AzRecoveryServicesVaultProperty : One or more errors occurred.
At line:1 char:1

  • Set-AzRecoveryServicesVaultProperty
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : CloseError: (:) [Set-AzRecoveryServicesVaultProperty], AggregateException
  • FullyQualifiedErrorId : Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.SetAzureRmRecoveryServicesVaultPropert
Azure Site Recovery
Azure Site Recovery
An Azure native disaster recovery service. Previously known as Microsoft Azure Hyper-V Recovery Manager.
672 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Matthew Bradley 1 Reputation point
    2020-11-10T12:56:11.64+00:00

    Hi,

    Your PowerShell references -Vault $status. If $status if your Vault ID then you need to change this to -VaultID $status. You are missing the ID off the end of VaultID.

    That should fix the identifier issue.

    Thanks,
    Matt


  2. Cloud Kid 1 Reputation point
    2020-11-23T14:41:18.447+00:00
    PS /home/CloudKid> $myVault = Get-AzRecoveryServicesVault -Name Vault773 -ResourceGroupName TestRG
    PS /home/CloudKid> $myVault.Id
    /subscriptions/9c75e489-54ef-4e72-99a4-e87860041a2c/resourceGroups/TestRG/providers/Microsoft.RecoveryServices/vaults/vault773