While inserting in azure table storage using Async method some records are getting failed to insert in table storage?
While inserting in azure table storage using Async method some records are getting failed to insert in table storage?
anonymous user Welcome to Microsoft Q&A forums.
Here is a function I wrote using the Azure.Data.Tables (beta) SDK
public async Task InsertOrMergeEntityAsync<T>(string tableName, T tableEntity) where T : class, ITableEntity, new()
{
try
{
if (tableEntity == null)
{
throw new ArgumentNullException("InsertOrMergeEntityAsync");
}
// Create a table client for interacting with the table service
var tableClient = GetAuthenticatedTableClient(tableName);
var result = await tableClient.UpsertEntityAsync(tableEntity, TableUpdateMode.Merge);
//if (result.RequestCharge.HasValue)
//{
// Console.WriteLine("Request Charge of Delete Operation: " + result.RequestCharge);
//}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
Do let us know if you have any questions
If an answer is helpful, please "Accept answer" or "Up-Vote" which might help other community members reading this thread.
3 people are following this question.