How to create a Storage Account in Microsoft Azure

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 an essential component: a Storage Account.

An Azure storage account provides a unique namespace in the cloud to store and access your data objects in Azure Storage. A storage account contains any blobs, files, queues, tables, and disks that you create under that account.

This tutorial assumes that you already have a Microsoft Azure account set up.

Azure PowerShell Workaround

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.

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:

Once you set your default subscription, you are ready to create a Storage Account with New-AzureRmStorageAccount cmdlet.

New-AzureRmStorageAccount

To create a Storage Account with PowerShell, use the New-AzureRmStorageAccount cmdlet with the following syntax:

-Name Parameter

When selecting your storage account name, remember these rules:

  • Storage account names must be between 3 and 24 characters in length and may contain numbers and lowercase letters only.
  • Your storage account name must be unique within Azure. No two storage accounts can have the same name.

You can check if the name of an Azure Storage account is valid and available to use with Get-AzureRmStorageAccountNameAvailability cmdlet.

-ResourceGroupName Parameter

With the following command in PowerShell, we obtain the list of existing resource groups in your subscription.

Get-AzureRmResourceGroup

If you need to create a new resource group, check out this link.

-Location Parameter

With the following cmdlet in PowerShell, we obtain the list of existing locations in Azure.

-SkuName Parameter

The SKU name is the name of the type of storage account that we are going to use. The storage account types and their names are:

Locally-redundant storage: Standard_LRS
Zone-redundant storage: Standard_ZRS
Geo-redundant storage: Standard_GRS
Read access geo-redundant storage: Standard_RAGRS
Premium locally-redundant storage: Premium_LRS

You can verify the task by running the Get-AzureRmStorageAccount cmdlet.

Azure CLI Workaround

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.

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:

To create a Storage Account with Azure CLI, use the following syntax:

–Name Parameter

When selecting your storage account name, remember these rules:

  • Storage account names must be between 3 and 24 characters in length and may contain numbers and lowercase letters only.
  • Your storage account name must be unique within Azure. No two storage accounts can have the same name.

–resource-group Parameter

With the following command in Azure CLI, we obtain the list of existing resource groups in your subscription.

To create a new resource group with Azure CLI, check out this link.

–location Parameter

With the following command, we obtain the list of existing locations in Azure.

–sku Parameter

The SKU name is the name of the type of storage account that we are going to use. The storage account types and their names are:

Locally-redundant storage: Standard_LRS
Zone-redundant storage: Standard_ZRS
Geo-redundant storage: Standard_GRS
Read access geo-redundant storage: Standard_RAGRS
Premium locally-redundant storage: Premium_LRS

As you can see in the screenshot, you can use the online command help with the –help or -h parameter.

az storage account create --help

You can check the task by running the following command, the -g parameter indicates the Resource Group:

If you want to know more about Azure Storage Account, check out this link:https://docs.microsoft.com/en-us/azure/storage/