Microsoft.Azure.Cosmos.Table POST requests to https://<account>.table.core.windows.net:443/Tables() failing with 409

adriana_malea 111 Reputation points
2022-04-11T13:32:06.44+00:00

Hello,

A function app written with dotnet 3.1, that uses Microsoft.Azure.Cosmos.Table Version="1.0.8" keeps posting requests to https://<account>.table.core.windows.net:443/Tables(), failing with 409, even if it's a scenario in which I am not accessing the Azure storage tables at all.

 public async Task AnOrchestration(
           [DurableClient] IDurableOrchestrationClient client,
           ILogger log,
           [Table("CalloutsTable")] CloudTable cloudTable)
        {
                var idList = await GetList....(params);

                foreach (var x in idList)
                {
                    doSomething...();

                    await 
                        cloudTable.ExecuteAsync(TableOperation.Insert(idList+others));
                }
        }

When the list is empty, that foreach is not executed, so no insert to be done.
But still, the client library tries a POST failing with 409.

I have noticed an older post here 42, saying that

'this seems to be expected behavior for the client library 8+ CloudTable.CreateIfNotExists throws a 409 error and moves on if the table already exists.'

I mention that my table already exists, is not created dynamically via the app.

Is this the usual behavior of Azure.Cosmos.Table 1.0.8?

Thank you!

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
3,000 questions
Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,050 questions
0 comments No comments
{count} votes

Accepted answer
  1. MikeUrnun 5,756 Reputation points
    2022-04-14T23:29:01.893+00:00

    Hello @adriana_malea - The error probably isn't caused by the Insert() statement in your foreach() loop. This appears to be a known issue around the behavior of CloudTable.CreateIfNotExists() where it tries to create the table first, and if there's an existing table, it'll return the 409 which is a “The specified entity already exists” error... as opposed to checking for an existing table first and attempting to create it only if there isn't one.

    Here're a couple of resources:

    It looks like you're using Durable Functions. Are you calling the CloudTable.CreateIfNotExists() somewhere?

    All in all, the error appears to be harmless but makes a lot of noise in telemetries and is expected to be fixed in the next SDK release.

    I hope this is helpful, if any further questions, just let me know.

    -------------------------------------------------------------------------------

    Please consider contributing to MS Q&A by marking 'Accepted Answer' and ‘Upvoting’ as applicable.


0 additional answers

Sort by: Most helpful