Automating tasks
So, we have reached the final destination of the chapter, where we automate all of the manual tasks that we have covered.
Building a Recovery Services vault using Azure PowerShell
To work with Azure Recovery Services, you have to register the Recovery Services provider by running the following cmdlet:
Register-AzureRmResourceProvider -ProviderNamespace "Microsoft.RecoveryServices"
Then, you can create the Recovery Services vault by running the following cmdlet:
New-AzureRmRecoveryServicesVault -Name PSRS -ResourceGroupName "PacktPub" -Location "West Europe"
Building a Recovery Services vault using the Azure CLI 2.0
In order to run Azure Backup commands using the Azure CLI 2.0, you have to upgrade to the latest version of the Azure CLI 2.0 from the following link: https://azurecliprod.blob.core.windows.net/msi/azure-cli-2.0.18.msi.
Once downloaded and installed, you can run the following command to create a Recovery Services vault:
az backup vault create --resource-group PacktPub...