question

NishanthS-8515 avatar image
0 Votes"
NishanthS-8515 asked KalyanChanumolu-MSFT answered

Async table storage Insertion issue

While inserting in azure table storage using Async method some records are getting failed to insert in table storage?

azure-table-storage
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

KalyanChanumolu-MSFT avatar image
0 Votes"
KalyanChanumolu-MSFT answered

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.