I have method that submits batch transaction to table storage (Nuget: Azure.Data.Tables - 12.6.1).
Code below:
private static async Task BatchManipulateEntities<T>(TableClient tableClient, IEnumerable<T> entities, TableTransactionActionType tableTransactionActionType, int batchSize) where T : class, ITableEntity, new()
{
var groups = entities.GroupBy(x => new { x.PartitionKey });
foreach (var group in groups)
{
var items = group.AsEnumerable();
while (items.Any())
{
var batch = items.Take(batchSize);
items = items.Skip(batchSize);
var actions = batch.Select(e => new TableTransactionAction(tableTransactionActionType, e)).ToList();
await tableClient.SubmitTransactionAsync(actions); // <-- Will this count as one batch write operation?
}
}
}
This will call SubmitTransactionAsync with up to hundred TableTransactionActions. But will the submitted batch transaction count as one "batch write operation behind the scenes or will it actually be 100 different ones?
Batch write operation is three times more costly than normal write operation, but if behind the scenes hundred entities will be uploaded as one batch write operation than I'm a happy man ;)
Azure Table Storage Pricing
Really would appreciate if somebody smarter can clarify this!