Accessing Read-access geo-redundant storage (RA-GRS)


  • How do i access the secondary Read-access geo-redundant storage (RA-GRS)?

    I can access the Blob Storage using but if I add example-secondary I get an error. 

    This connects: 

    This does not:

    In the meantime I temporarily converted the access type on the container to blob after which I was able to download my file using both links https://example1.blob.core... and https://example1-secondary.blo.... However this means anyone can access those URLs and download the data.  I know I can access Shared Access Signatures to secure the data however I would prefer the standard way of accessing the read only storage account as I would like to perform SQL data restores directly from the files available on the read only account using the SQL restore from URL option instead of having to download the data locally first.

    Many thanks


    Monday, April 11, 2016 10:13 AM

All replies

  • How are you trying to retrieve data from the secondary, and what error are you getting?

    You have the format of the secondary correct.

    I just wrote some code to do this on an RA-GRS account, and it worked just fine. Here's my code. Note that the thread sleeps for five minutes to allow the secondary to update, which was sufficient when I just tried it. However, it may take up to fifteen minutes for the secondary to update. The interval is not guaranteed.

    // Retrieve storage account from connection string.
    CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
    // Create the blob client.
    CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
    // Retrieve a reference to a container.
    CloudBlobContainer container = blobClient.GetContainerReference("mycontainer" + DateTime.Now.Ticks);
    // Create the container if it doesn't already exist.
    // Retrieve reference to a blob named "myblob.txt".
    CloudBlockBlob blockBlob = container.GetBlockBlobReference("myblob.txt");
    Console.WriteLine("primary URI: {0}", blockBlob.StorageUri.PrimaryUri);
    Console.WriteLine("secondary URI: {0}", blockBlob.StorageUri.SecondaryUri);

    Monday, April 11, 2016 11:50 PM