Create an Azure storage account

An Azure storage account contains all of your Azure Storage data objects: blobs, files, queues, and tables. The storage account provides a unique namespace for your Azure Storage data that is accessible from anywhere in the world over HTTP or HTTPS. For more information about Azure storage accounts, see Storage account overview. To create a storage account specifically for use with Azure Files, see Create an SMB file share.

In this how-to article, you learn to create a storage account using the Azure portal, Azure PowerShell, Azure CLI, or an Azure Resource Manager template.

Prerequisites

If you don't have an Azure subscription, create a trial account before you begin.

You can install the CLI and run CLI commands locally.

Install the Azure CLI locally

If you plan to use Azure CLI locally, make sure you have installed the latest version of the Azure CLI. See Install the Azure CLI.

Next, sign in to Azure.

To log into your local installation of the CLI, run the az sign-in command:

az login

Create a storage account

A storage account is an Azure Resource Manager resource. Resource Manager is the deployment and management service for Azure. For more information, see Azure Resource Manager overview.

Every Resource Manager resource, including an Azure 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 how-to shows how to create a new resource group.

Storage account type parameters

When you create a storage account using PowerShell, the Azure CLI, Bicep, or Azure Templates, the storage account type is specified by the kind parameter (for example, StorageV2). The performance tier and redundancy configuration are specified together by the sku or SkuName parameter (for example, Standard_GRS). The following table shows which values to use for the kind parameter and the sku or SkuName parameter to create a particular type of storage account with the desired redundancy configuration.

Type of storage account Supported redundancy configurations Supported values for the kind parameter Supported values for the sku or SkuName parameter Supports hierarchical namespace
Standard general-purpose v2 LRS / GRS / RA-GRS / ZRS / GZRS / RA-GZRS StorageV2 Standard_LRS / Standard_GRS / Standard_RAGRS/ Standard_ZRS / Standard_GZRS / Standard_RAGZRS Yes
Premium block blobs LRS / ZRS BlockBlobStorage Premium_LRS / Premium_ZRS Yes
Premium file shares LRS / ZRS FileStorage Premium_LRS / Premium_ZRS No
Premium page blobs LRS StorageV2 Premium_LRS No
Legacy standard general-purpose v1 LRS / GRS / RA-GRS Storage Standard_LRS / Standard_GRS / Standard_RAGRS No
Legacy blob storage LRS / GRS / RA-GRS BlobStorage Standard_LRS / Standard_GRS / Standard_RAGRS No

To create a general-purpose v2 storage account with Azure CLI, first create a new resource group by calling the az group create command.

az group create \
  --name storage-resource-group \
  --location chinaeast2

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 standard general-purpose v2 storage account with read-access geo-redundant storage by using the az storage account create command. Remember that the name of your storage account must be unique across Azure, so replace the placeholder value in brackets with your own unique value:

az storage account create \
  --name <account-name> \
  --resource-group storage-resource-group \
  --location chinaeast2 \
  --sku Standard_RAGRS \
  --kind StorageV2 \
  --min-tls-version TLS1_2 \
  --allow-blob-public-access false

To enable a hierarchical namespace for the storage account to use Azure Data Lake Storage, set the enable-hierarchical-namespace parameter to true on the call to the az storage account create command. Creating a hierarchical namespace requires Azure CLI version 2.0.79 or later.

Delete a storage account

Deleting a storage account deletes the entire account, including all data in the account. Be sure to back up any data you want to save before you delete the account.

If you try to delete a storage account associated with an Azure virtual machine, you might get an error about the storage account still being in use. For help with troubleshooting this error, see Troubleshoot errors when you delete storage accounts.

To delete the storage account, use the az storage account delete command:

az storage account delete --name <storage-account> --resource-group <resource-group>

Alternately, you can delete the resource group, which deletes the storage account and any other resources in that resource group. For more information about deleting a resource group, see Delete resource group and resources.

Create a general purpose v1 storage account

Note

Although Azure recommends general-purpose v2 accounts for most scenarios, Azure will continue to support general-purpose v1 accounts for new and existing customers. You can create general-purpose v1 storage accounts in new regions whenever Azure Storage is available in those regions. Azure does not currently have a plan to deprecate support for general-purpose v1 accounts and will provide at least one year's advance notice before deprecating any Azure Storage feature. Azure will continue to provide security updates for general-purpose v1 accounts, but no new feature development is expected for this account type.

For new Azure regions that have come online after October 1, 2020, pricing for general-purpose v1 accounts has changed and is equivalent to pricing for general-purpose v2 accounts in those regions. Pricing for general-purpose v1 accounts in Azure regions that existed prior to October 1, 2020 has not changed.

General purpose v1 (GPv1) storage accounts can no longer be created from the Azure portal. If you need to create a GPv1 storage account, follow the steps in section Create a storage account for PowerShell, the Azure CLI, Bicep, or Azure Templates. For the kind parameter, specify Storage, and choose a sku or SkuName from the table of supported values.

Next steps