Get newest entry in Azure Table Storage

Recently I had the requirement of retreiving the newest entry in an Azure Table Storage table. While there’s of course the Timestamp column that could be used to indetify the desired row, we would need to query the whole table to find the youngest date. This could be narrowed down by for example knowing on which day a record was added and filtering accordingly, but we’d probably still get multiple rows to check manually for the newest one.

Get newest entry in Azure Table Storage weiterlesen

Deleting all Rows from Azure Table Storage (as fast as possible)

In this post we will see how to efficiently delete all rows in an Azure Table Storage using the new(ish) Azure.Data.Tables SDK. We’ll try to optimize for speed while also being mindful about the memory.

Note: When deleting a lot of data from Azure Table Storage usually the fastest way is to just drop the whole table. However, we cannot be sure when exactly we’re able to create a new table with the same name since it can take up to a minute or even longer for Azure to actually get rid of the table.

Deleting all Rows from Azure Table Storage (as fast as possible) weiterlesen

Application Insights & Azure Table Storage CreateIfNotExists Errors

When working with Azure Table Storage and Application Insights you might have noticed a lot of dependency errors, logging a 409 Conflict event everytime the CreateIfNotExists() method is called to make sure a table is available.

This is because the Azure.Data.Tables SDK will simply try to create a new table — and will hide the error if it already exists. While you don’t notice this in the code, by default Application Insights will catch this and clutter your logs with errors you probably don’t want.

Application Insights & Azure Table Storage CreateIfNotExists Errors weiterlesen

Which Azure Table Storage .NET SDK should I use?

When working with Azure Table Storage (ATS) in C# / .NET there are currently at least four NuGet packages offered by Microsoft for working with tables. It gets even more complicated as there’s an Azure.Storage SDK (currently in Version 12) that works with all Azure Storage Account related services — except Table Storage. Additionally Microsoft mostly talks about the CosmosDB Table API, but all libraries also work with the regular ATS since the APIs are identical.

So what are our options and which one should I choose?

Which Azure Table Storage .NET SDK should I use? weiterlesen