In this Azure tutorial, we will discuss what a storage account key is in Azure and how to get it using Azure Portal, PowerShell, and Azure CLI.
Table of Contents
How to get storage account key in Azure
Azure storage account access keys are the keys that are generated by default when you create an Azure storage account. Those two access keys are used to authorize access to the data inside your Azure Storage Account.
These master keys are 512-bit.
Out of these two keys, you can use any one of the access keys for the authorization process to access your Storage Account.
Approach 1: Using Azure Portal
To get storage account key in Azure, follow the steps below.
- Log in to the Azure Portal.
- Search for Storage accounts and click on the search result Storage accounts.

3. You can now see the lists of Storage accounts you created. Click on the specific storage account for the one you wish to get the access key.
4. Click the Access keys link on the Storage account page, under Security + networking.

5. You can see Keys 1 and 2 on the right side. By default, it is hidden. Click on the Show button for each one to view the key.

If you don’t want to use the old key and want to regenerate a new access key for your Azure Storage account, you can click the “Rotate key” button. However, before that, it is essential to note that the old key is not recoverable.

On the ‘Regenerate access key’ pop-up, read the information carefully, and click the ‘Yes’ button to confirm the process of generating a new access key for your Azure Storage account.

Approach 2: Using PowerShell
You can find the storage account key in Azure using the Get-AzStorageAccountKey Azure PowerShell cmdlet.
Syntax:
Below is the syntax to retrieve the Storage key in Azure.
Get-AzStorageAccountKey -ResourceGroupName "Your Resource group name" -Name "Storage account name"Example: In the below example, DEMORG1 is the name of my Resource Group, and demoggh is the name of my Azure Storage account.
Get-AzStorageAccountKey -ResourceGroupName "DEMORG1" -Name "demoggh"After executing the above script, I got the following output
KeyName Value
------- -----
key1 1dMSmTL3GNTqBqpi+iSbfqDY/43rqthsWb/u1EVwiKZTXsS+urwmQ+xxxxxxL2md8aqVZtF4...
key2 vYQVP59KPHvBUqFcY3YP4Gl/GveV9HTnwIm0z+ZBvyHeuKHmxxxxxxxxxx+XIdZ2OnDY86m6Q...
You can see it here

Approach 3: Using Azure CLI
You can use Azure CLI to find your Azure Storage Access key using the below command.
az storage account keys list -g ResourceGroupname -n StorageAccountnameExample: Here, DEMORG1 is my Resource Group name, and demoggh is my Azure Storage account name.
az storage account keys list -g DEMORG1 -n demogghAfter executing the above Azure CLI command, I got the following output.
[
{
"keyName": "key1",
"permissions": "FULL",
"value": "1dMSmTL3GNTqBqpi+iSbfqDY/43rqthsWb/u1EVwiKZTXsS+urwmQ+xxxxxxxx2md8aqVZt
F4C+AStq2JC8g=="
},
{
"keyName": "key2",
"permissions": "FULL",
"value": "vYQVP59KPHvBUqFcY3YP4Gl/GveV9HTnwIm0z+ZBvyHeuKxxxxxxxxxxx+XIdZ2OnDY86m
6QK+AStIWwqVg=="
}
]You can see it here

Wrapping Up
In this article, we discussed what an Azure storage account access key is and how to obtain one using the Azure Portal, PowerShell, and Azure CLI. Thanks for reading this article.
You may also like the following articles below
- How to Secure Azure Storage Account
- Azure storage types
- Azure Storage Explorer
- How to Upload and Download a File From Azure Blob Storage Using C# and PowerShell
- How to Create an Azure Free Account (Step-by-Step tutorial)
- How To Get Azure Storage Account URL

I am Rajkishore, and I am a Microsoft Certified IT Consultant. I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machines, Logic Apps, PowerShell Commands, CLI Commands, Machine Learning, AI, Azure Cognitive Services, DevOps, etc. Not only that, I do have good real-time experience in designing and developing cloud-native data integrations on Azure or AWS, etc. I hope you will learn from these practical Azure tutorials. Read more.
