This quickstart requires the Azure PowerShell module version 3.6 or later. Run Get-Module -ListAvailable AzureRM to find your current version. If you need to install or upgrade, see Install Azure PowerShell module.
You can log in to Azure and run Azure CLI commands in one of two ways:
You can run CLI commands from within the Azure portal, in Azure Cloud Shell
You can install the CLI and run CLI commands locally
Use Azure Cloud Shell
Azure Cloud Shell is a free Bash shell that you can run directly within the Azure portal. It has the Azure CLI preinstalled and configured to use with your account. Click the Cloud Shell button on the menu in the upper-right of the Azure portal:
The button launches an interactive shell that you can use to run the steps in this quickstart:
Install the CLI locally
You can also install and use the Azure CLI locally. This quickstart requires that you are running the Azure CLI version 2.0.4 or later. Run az --version to find the version. If you need to install or upgrade, see Install the Azure CLI.
Log in to your Azure subscription with the Connect-AzureRmAccount command and follow the on-screen directions to authenticate.
Connect-AzureRmAccount
To launch Azure Cloud Shell, log in to the Azure portal.
To log into your local installation of the CLI, run the login command:
az login
Create a storage account
Now you are ready to create your storage account.
Every storage account must belong to an Azure resource group. A resource group is a logical container for grouping your Azure services. When you create a storage account, you have the option to either create a new resource group, or use an existing resource group. This quickstart shows how to create a new resource group.
A general-purpose v2 storage account provides access to all of the Azure Storage services: blobs, files, queues, tables, and disks. The quickstart creates a general-purpose v2 storage account, but the steps to create any type of storage account are similar.
To create a general-purpose v2 storage account in the Azure portal, follow these steps:
In the Azure portal, click All services. In the list of resources, type Storage Accounts. As you begin typing, the list filters based on your input. Select Storage Accounts.
On the Storage Accounts window that appears, choose Add.
Select the subscription in which to create the storage account.
Under the Resource group field, select Create new. Enter a name for your new resource group, as shown in the following image.
Next, enter a name for your storage account. The name you choose must be unique across Azure. The name also must be between 3 and 24 characters in length, and can include numbers and lowercase letters only.
Select a location for your storage account, or use the default location.
Leave these fields set to their default values:
Field
Value
Deployment model
Resource manager
Performance
Standard
Account kind
StorageV2 (general-purpose v2)
Replication
Locally-redundant storage (LRS)
Access tier
Hot
Click Review + Create to review your storage account settings and create the account.
# put resource group in a variable so you can use the same group name going forward,
# without hardcoding it repeatedly
$resourceGroup = "storage-quickstart-resource-group"
New-AzureRmResourceGroup -Name $resourceGroup -Location $location
If you're not sure which region to specify for the -Location parameter, you can retrieve a list of supported regions for your subscription with the Get-AzureRmLocation command:
To create a general-purpose v2 storage account with zone-redundant storage (ZRS) (preview), geo-redundant storage (GRS), or read-access geo-redundant storage (RA-GRS), substitute the desired value in the table below for the SkuName parameter.
Replication option
SkuName parameter
Locally-redundant storage (LRS)
Standard_LRS
Zone-redundant storage (ZRS)
Standard_ZRS
Geo-redundant storage (GRS)
Standard_GRS
Read-access geo-redundant storage (GRS)
Standard_RAGRS
First, create a new resource group with Azure CLI using the az group create command.
az group create \
--name storage-quickstart-resource-group \
--location westus
If you're not sure which region to specify for the --location parameter, you can retrieve a list of supported regions for your subscription with the az account list-locations command.
az account list-locations \
--query "[].{Region:name}" \
--out table
Next, create a general-purpose v2 storage account with locally-redundant storage. Use the az storage account create command:
To create a general-purpose v2 storage account with zone-redundant storage (ZRS Preview), geo-redundant storage (GRS), or read-access geo-redundant storage (RA-GRS), substitute the desired value in the table below for the sku parameter.
If you wish to clean up the resources created by this quickstart, you can simply delete the resource group. Deleting the resource group also deletes the associated storage account, and any other resources associated with the resource group.
To remove a resource group using the Azure portal:
In the Azure portal, expand the menu on the left side to open the menu of services, and choose Resource Groups to display the list of your resource groups.
Locate the resource group to delete, and right-click the More button (...) on the right side of the listing.
Select Delete resource group, and confirm.
To remove the resource group and its associated resources, including the new storage account, use the Remove-AzureRmResourceGroup command:
Remove-AzureRmResourceGroup -Name $resourceGroup
To remove the resource group and its associated resources, including the new storage account, use the az group delete command.
az group delete --name myResourceGroup
Next steps
In this quick start, you've created a general-purpose standard storage account. To learn how to upload and download blobs to and from your storage account, continue to the Blob storage quickstart.