I am working on a .NET Core 3.0 C# example of the Repository design pattern leverage Azure Table Storage.
I have been using the Microsoft.Azure.Cosmos.Table library.
One thing that is nice about leveraging the available SDKs is that a Retry design pattern is often implemented by default using Polly.
For the life of me, I could not figure out what the retry policy was for the Microsoft.Azure.Cosmos.Table library.
I scoured all the related documentation and came up with nothing.
I know that when using the Microsoft.Azure.Cosmos library the default retry policy is to retry up to 9 times, maybe it was 9 because I was using the Table Api from Cosmos? Or maybe it was some other value.
So I fired up my project in Visual Studio 2019 in debug mode and took a peak at the RetryPolicy
property for the instance of the CloudTableClient
.
B-I-N-G-O! There it was.
The Microsoft.Azure.Cosmos.Table library uses ExponentialRetry with a maximum of 3 retries.
If you are interested in customizing the retry policy, take a look at https://www.chasingdevops.com/customizing-retry-logic-in-the-net-azure-storage-sdk on Chasing DevOps to learn how.
Related Articles
- Table design patterns https://docs.microsoft.com/en-us/azure/storage/tables/table-storage-design-patterns
- Developing with Azure Cosmos DB Table API and Azure Table storage https://docs.microsoft.com/en-us/azure/cosmos-db/table-support
- Retry guidance for specific services in Azure https://docs.microsoft.com/en-us/azure/architecture/best-practices/retry-service-specific
Hope this article saves a fellow developer a search or two!
Discover more from Matt Ruma
Subscribe to get the latest posts sent to your email.