Get the storage access key

The storage account key is a 512b access key used for authentication when accessing the storage account. It’s generated automatically when the storage account is created. For details about keys, regeneration of the keys, etc., see the az storage account list topic on the Microsoft website.

List storage account keys in Azure CLI with the command below:

az storage account keys list --account-name <ACCOUNT_NAME> --resource-group <RESOURCE_GROUP>

Replace the ACCOUNT_NAME and RESOURCE_GROUP strings with the storage account and resource group names obtained in the previous section. The command will list two storage account keys in JSON format (default format, but can be changed): primary (key1) and secondary (key2). You can use either key.