Azure CLI Azure Cloud Shell Azure PowerShell Get-AzRecoveryServicesVault Get-AzSubscription Login-AzAccount Microsoft Microsoft Azure New-AzRecoveryServicesVault Recovery Services vault Select-AzSubscription Set-AzRecoveryServicesBackupProperties Storage
This post is part of a series in which I will show how to create different resources in Microsoft Azure. Today I will show you how to create a component that every Azure subscription should have: an Azure Recovery Service vault. You can use Recovery Services vaults to store backup data for various Azure services such as VMs, Azure File shares, Azure SQL databases, and more. This tutorial assumes that you already have a Microsoft Azure account configured.
If you want to know how to install the PowerShell Azure module on your machine, check out this
link. The simplest way to get started is to sign in interactively at the command line.
Login-AzAccount
This cmdlet will bring up a dialog box prompting you for your email address and password associated with your Azure account. If you have more than one subscription associated with your mail account, you can choose the default subscription. To perform this task we will use the following commands:
The recovery service vault is a resource and you must place it within a Resource Group. You can use an existing Resource Group or you can create a new Resource Group. If you want to know how to create a Resource Group using Powershell, check out this
link. To create a Recovery Service vault with Azure PowerShell, use the New-AzRecoveryServicesVault cmdlet with the following syntax:
-BackupStorageRedundancy: Specify the type of storage redundancy to use.
GeoRedundant
LocallyRedundant
You can verify the task by running the Get-AzRecoveryServicesVault cmdlet. This cmdlet gets the list of vaults in the Resource Group in the selected subscription.
You can use it in your browser with Azure Cloud Shell, or install it on your machine. If you want to know how to install the Azure CLI, check out this
link. The way to get started is to sign in interactively at the command line.
az login
This command will bring up a dialog box prompting you for your email address and password associated with your Azure account. If you have more than one subscription associated with your mail account, you can choose the default subscription. to perform this task we will use the following commands:
az account list
az account set --subscription "Subscription Name"
The recovery service vault is a resource and you must place it within a Resource Group. You can use an existing Resource Group or you can create a new Resource Group. If you want to know how to create a Resource Group using Azure CLI, check out this
link. To create an Azure Recovery Services vault with Azure CLI, use the following syntax: