
In this Azure tutorial, we will discuss what is storage account key in Azure and how to get it.
Table of Contents
Azure Storage Account Key
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 of 512-bit.
Out of these two keys, you can use any one of the access keys for the authorization process to access your Sorage Account.
How to get storage account key in Azure
Well, it’s quite easy to find the storage account access key in Azure using the below steps in the Azure Portal.
- Log in to Azure Portal.
- Search for Storage accounts and click on the search result Storage accounts.

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

5. You can see Key 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 the old key and want to regenerate a new access key of your Azure Storage account, you can click the Rotate key button. But before that, an important point to remember is the old key is not recoverable.

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

How to get Azure storage account access key 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 below output
KeyName Value
------- -----
key1 1dMSmTL3GNTqBqpi+iSbfqDY/43rqthsWb/u1EVwiKZTXsS+urwmQ+xxxxxxL2md8aqVZtF4...
key2 vYQVP59KPHvBUqFcY3YP4Gl/GveV9HTnwIm0z+ZBvyHeuKHmxxxxxxxxxx+XIdZ2OnDY86m6Q...
You can see it here

How to get Azure storage account access key using Azure CLI
You can use Azure CLI to find your Azure Storage Access key using the below cmdlet.
az storage account keys list -g ResourceGroupname -n StorageAccountname
Example: Here, DEMORG1 is my Resource Group name, and demoggh is my Azure Storage account name.
az storage account keys list -g DEMORG1 -n demoggh
After executing the above Azure CLI cmdlet, I got the below 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

You may also like following the articles below
- Azure storage types
- Azure storage explorer
- How to Upload and Download File From Azure Blob Storage Using C# and PowerShell
- How to Create Azure Free Account (Step by Step tutorial)
Wrapping Up
Well, in this article, we discussed what is Azure storage account access key, and how to get Azure storage account access key in Azure Portal using PowerShell and using Azure CLI. Thanks for reading this article.

I am Rajkishore, and I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machine, 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.