I'd like to use managed identity when connecting to cosmos db table api from an azure function.
Uri tableEndpoint = new Uri("https://mycosmos.table.cosmos.azure.com:443/");
var tableServiceClient = new TableServiceClient(tableEndpoint, new DefaultAzureCredential());
var tableClient = tableServiceClient.GetTableClient(tableName);
This causes the following error:
Authorization header doesn't confirm to the required format
I've read that cosmos db table api does not yet support managed identity but that was over 2 years ago - I'm hoping that it is now possible?
As per November 2023, this is still not supported (see documentation):
Azure Storage Table do support managed identity and could be an alternative:
you would need to grant
Storage Table Data ContributororStorage Table Data Readerrole to the managed identity.And here is a good article to check between storage and cosmos table: