How To Get Azure Blob Storage Connection String

In this Azure article, we will discuss where to find Azure storage account connection string from the Azure Portal and use PowerShell.

Get Azure Blob Storage Connection String

This contains the information required to access your Azure Storage account data from your application.

Approach-1: Using Azure Portal

Follow the below steps to quickly find the Azure Storage Account Connection String from the Azure Portal.

  1. Log in to Azure Portal and navigate to your storage account.
  2. On the Storage account page, click on the Access keys link from the left navigation, which is under the Security + networking tab.
az storage account show-connection-string

3. The connection strings are under Key1 and Key2. Click on the Show button next to the Connection string to see its value.

azure blob storage connection string

Now copy the connection string and utilize it wherever you need it.

Approach-2: Using PowerShell

Follow the below steps

  1. Open Windows PowerShell ISE with Run as administrator mode.
  2. Execute the below PowerShell command to get the details of the Azure storage account connection string.
$myrsg = "Demo123"
$mystrgact = "demo123b08c"
(Get-AzStorageAccount -ResourceGroupName $myrsg  -Name $mystrgact).Context.ConnectionString

Note: Please change the values for the storage account and Resource Group names as per yours.

After executing the above PowerShell script, I got the below output as expected.


BlobEndpoint=https://demo123b08c.blob.core.windows.net/;QueueEndpoint=https://demo123b08c.queue.core.windows.net/;TableEndpoint=https://demo123b08c.tabl
e.core.windows.net/;FileEndpoint=https://demo123b08c.file.core.windows.net/;AccountName=demo123b08c;AccountKey=177mjClvorkM5RzZwIM/EMaUQpJH+O1vFu1FwjvgL
q4xESDkJ3YCuF8On63+sm8XS3e+zizdzyKO+AStQYfGCQ==

You can see the same output below

connection string storage account azure

Approach-3: Using Azure CLI

You can also use the below command to get the Azure storage account connection string using Azure CLI.

az storage account show-connection-string --resource-group Demo123 --name demo123b08c

Note: Please change the values for the storage account and Resource Group names as per yours.

After executing the above command, I got the below-expected output

"connectionString": "DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=demo123b08c;AccountKey=177mjClvorkM5RzZwIM/EMaUQpJH+O1vFu1FwjvgLq4xESDkJ3YCuF8On63+sm8XS3e+zizdzyKO+AStQYfGCQ==;BlobEndpoint=https://demo123b08c.blob.core.windows.net/;FileEndpoint=https://demo123b08c.file.core.windows.net/;QueueEndpoint=https://demo123b08c.queue.core.windows.net/;TableEndpoint=https://demo123b08c.table.core.windows.net/"

See the same output in the below screenshot.

How to find Azure storage account connection string using Azure CLI

Video Tutorial

Wrapping Up

In this Azure article, we discussed how to get Azure Storage Account Connection String using Azure Portal, PowerShell, and Azure CLI. Thanks for reading this article !!!

Azure Virtual Machine

DOWNLOAD FREE AZURE VIRTUAL MACHINE PDF

Download our free 25+ page Azure Virtual Machine guide and master cloud deployment today!