In order to achieve High Availability we have created two blob containers under different storage accounts at different Azure regions.
So that, if application find issues while WRITING to primary blob container, application will perform circuit-breaker logic and if issue persists even after threshold number of attempts, application will start WRITING to stand-by blob storage account which is located in different Azure location & this architecture works fine.
Code used to switch from primary to secondary:
AsyncLazy<CloudQueue> qClient = new AsyncLazy<CloudQueue>(async () =>
{
var myStorageAccount = CloudStorageAccount.Parse("ConnectionString");
var myQueue = myStorageAccount.CreateCloudQueueClient();
myQueue.DefaultRequestOptions = new QueueRequestOptions
{
RetryPolicy = new ExponentialRetry(TimeSpan.FromSeconds(3), 4),
LocationMode = LocationMode.PrimaryThenSecondary,
MaximumExecutionTime = TimeSpan.FromSeconds(20)
};
var queue = myQueue.GetQueueReference("QueueName");
await queue.CreateIfNotExistsAsync();
return queue;
});
Now the problem is, how to sync back the data written to standby location with actual blob in primary location once primary account is back in action?
Azcopy is one option to sync two blobs on two different account but issue is as per this link official docker image of Azcopy not available yet
Is official docker image of Azcopy available if not what are the other suitable options to o sync two blobs on two different account on schedule time? Azure Data Factory? Azure function?


