This article is contributed. See the original author and article here.


With RA-GRS redundancy, you can read the data using secondary endpoint. The document points at connecting to Blob Storage using secondary endpoint and read data ahead.



We will be making use of connection string to connect to the secondary endpoint and follow the below steps:


Step 1: Obtain the connection string.

We can obtain this from Azure Portal, from Access Keys section under Security & Networking Pane of Storage Account Blade.



Step 2: Editing connection string to use Secondary Endpoint.

Append the BlobEndpoint section pointing to secondary endpoint at the end of the connection string like the one given below:




In case you want to leverage SAS, then you can edit the SAS URL to add secondary keyword after the account name and blob as endpoint. Below is one of the sample SAS URL:



Step 3: Connecting to Storage Account using the connection string.                                 

We will try connecting and accessing blobs using Azure Storage Explorer and via a powershell script. Let’s check for the process with first option.


When accessing via Azure Storage Explorer, you can follow the below steps of first selecting the resource type as Storage account.



Select the connection method as connection string and then provide the connection string created at step 2 along with the display name using which you want the connection to be displayed. Once done, click on the connect button.




At this point, the connection will get added under the Storage Accounts section of Local & Attached.


Step 4: Validations

To validate you are hitting the secondary endpoint only, you can configure fiddler as a proxy in the storage explorer and then try performing the operation of listing and reading (Get operation) while running the fiddler in the backend.



At the backend, you will see that you are hitting the secondary endpoint while trying to access the blobs.



In order to connect using Powershell, you can leverage below script to listing of the blobs inside a container.


$bMaxReturn = 100  


$storageContext = New-AzStorageContext -ConnectionString “<String Generated at Step 2>”




    # get a list of all of the blobs in the container    

    $listOfBlobs = Get-AzStorageBlob -Container “<Container Name>” -Context $storageContext -MaxCount $bMaxReturn -ContinuationToken $bToken    

                 if($listOfBlobs.Length -le 0) { Break;}   

          foreach($blob in $listOfBlobs) {   

               write-host “Blob name:” 

               write-host $blob.Name 


                    $bToken = $blob[$blob.Count -1].ContinuationToken; 

}while ($bToken -ne $Null)     



By using the following materials or sample code you agree to be bound by the license terms below and the Microsoft Partner Program Agreement the terms of which are incorporated herein by this reference. These license terms are an agreement between Microsoft Corporation (or, if applicable based on where you are located, one of its affiliates) and you. Any materials (other than sample code) we provide to you are for your internal use only. Any sample code is provided for the purpose of illustration only and is not intended to be used in a production environment. We grant you a nonexclusive, royalty-free right to use and modify the sample code and to reproduce and distribute the object code form of the sample code, if you agree:

  • to not use Microsoft’s name, logo, or trademarks to market your software product in which the sample code is embedded.

  • (ii) to include a valid copyright notice on your software product in which the sample code is embedded.

  • (iii) to provide on behalf of and for the benefit of your subcontractors a disclaimer of warranties, exclusion of liability for indirect and consequential damages and a reasonable limitation of liability; and

  • (iv) to indemnify, hold harmless, and defend Microsoft, its affiliates and suppliers from and against any third-party claims or lawsuits, including attorney’s fees, that arise or result from the use or distribution of the sample code.”

For any information regarding data redundancy, you can check this link.


Hope this helps!

Brought to you by Dr. Ware, Microsoft Office 365 Silver Partner, Charleston SC.

%d bloggers like this: