Azure Cosmosdb Managed Identity Failure
- 14 Jan 2022
Quick info blog - Customer code accessing Cosmos Db using the Azure Cosmos SDK showed failure in Application Insights: ManagedIdentityCredentials authentication failed.
Sample error: Message request to http://172.16.*.*:8081/msi/token?resource=https%3A%2F%2Fcosmos-name.documents.azure.com&api-version=2017-09-01%20application/json;%20charset=utf-8
Along with the above error, we also observed execution timeouts in FunctionLogs logs table.
Solution
Turns out the customer was using @azure/cosmos SDK earlier than v3.14.1. This version of the SDK was creating an AAD token with every request which resulted in throttling and authentication failed. This was fixed with version 3.14.1. see: azure-sdk-for-js/CHANGELOG.md at main ยท Azure/azure-sdk-for-js
Special thanks to my teammate for this content: Gilbert Appiah - Azure Rapid Response - Azure App Servivces!
<< Go Back