Recently, I got the requirement to use the az storage account show-connection-string Azure CLI command. This article will walk you through the syntax and usage of the Az storage account show-connection-string command.
Table of Contents
Az storage account show-connection-string
This command helps you to get the connection string for a storage account.
Syntax
az storage account show-connection-string -g YourResourceGroupName -n YourStorageAccountNameaz storage account show-connection-string -g YourResourceGroupName -n YourStorageAccountName --subscription YourSubscriptionNameExample-1
The command below will retrieve the connection string details of the specified storage account belonging to the mentioned Resource Group.
az storage account show-connection-string -g MyNewResGrp -n usasaupdatedAfter executing the above command, I got the expected output, as shown below.
PS /home/bijay> az storage account show-connection-string -g MyNewResGrp -n usasaupdated
{
"connectionString": "DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=usasaupdated;AccountKey=6OtW8Av6W0bkLVrYbM0rz1ltKJLP3Z4eAOsQqT/hLFDkSL+EModOC4UFq99hv6Z6+48IqTR2W0Me+AStBbjrjQ==;BlobEndpoint=https://usasaupdated.blob.core.windows.net/;FileEndpoint=https://usasaupdated.file.core.windows.net/;QueueEndpoint=https://usasaupdated.queue.core.windows.net/;TableEndpoint=https://usasaupdated.table.core.windows.net/"
}You can see the same output as shown in the screenshot shown below.

Example-2
The command below will retrieve the connection string (autogenerated) of the specified storage account belonging to the mentioned Resource Group.
az storage account show-connection-string -g MyNewResGrp -n usasaupdated --subscription "Visual Studio Enterprise"After executing the above query, I got the expected output, as shown in the screenshot below.

You may also like following the articles below.
- az storage account keys list
- Az storage account keys renew
- How To List The Storage Accounts In A Subscription On Azure PowerShell
- How To Check If Azure Storage Account Is Being Used

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.
