0

I am developing an Azure application (C#, .NET 6, ASP.NET Core) that uses Azure blob storage as well as table storage.

I have geo-redundancy enabled on my storage account (RA_GRS) so that if my main storage account goes down, a read-only copy will be available in another Azure region.

When reading from blob storage, as far as I understand, I should be able to get it to automatically fall back to the secondary address by setting the GeoRedundantSecondaryUri property like this (using the Azure.Storage.Blobs NuGet, version 12.8.4):

    return new BlobServiceClient(
        new Uri($"https://{accountName}.blob.core.windows.net/"),
        sharedKeyCredential,
        new BlobClientOptions
        {
            GeoRedundantSecondaryUri = new Uri($"https://{accountName}-secondary.blob.core.windows.net/")
        });

Can I do something similar when reading from table storage?

The classes I am using are CloudStorageAccount, CloudTableClient and CloudTable (from the Microsoft.Azure.Cosmos.Table NuGet, version 1.0.8). None of them seem to have a property similar to BlobClientOptions.GeoRedundantSecondaryUri. I don't know whether there is another set of classes I ought to use instead.

Is there any easy way to make Azure table storage fall back automatically, or will I have to implement it myself?

Claus Appel
  • 1,015
  • 10
  • 28
  • Can you share the SDK name and version you’re using to access Table Storage? – Gaurav Mantri Feb 08 '22 at 07:32
  • Good point. Added. I am using Azure.Storage.Blobs 12.8.4 and Microsoft.Azure.Cosmos.Table 1.0.8. – Claus Appel Feb 08 '22 at 07:37
  • 1
    Does [the code of ServiceRestClient](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/tables/Azure.Data.Tables/src/TableServiceClient.cs) useful to you ? – Jason Pan Feb 09 '22 at 07:49

0 Answers0