Environment: Azure app service.
Azure storage SDK: WindowsAzure.Storage (9.3.3)
Invocation (pseudo code):
void QueryAzureTable(){
while(true){
var tableClient = new AzureTable();
var resp = tableClient.Query('table','pk','rk');
// ...
}
}
var tasks = new List<Task>();
for (var i = 0; i < 5; i++)
{
tasks.Add(QueryAzureTable());
}
await Task.WhenAll(tasks).ConfigureAwait(false);
Authorization method for QueryAzureTable: tried with both clientId/secret and managed identity/MSI, same result for both.
Observation:
- Around half of the requests failed due to anth issue in
QueryAzureTable()
(see detailed error msg below). - If I restart the azure app service instance, the auth error will be gone for ~12 hours.
Error Message:
- Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
- Unexpected response code, Expected:OK or NotFound, Received:Forbidden
I have checked and tried with almost every solutions mentioned in this stackoverflow thread, but no luck. Guess this specific auth issue might be related with multi-tasks.