0

Using this library: https://www.npmjs.com/package/@azure/app-configuration

Following the setup, when I make any request using the AppConfigurationClient I get a 401 error. In the response headers, I see:

www-authenticate: HMAC-SHA256 error="invalid_token", error_description="Invalid Credential"

which is mentioned in this documentation:

https://learn.microsoft.com/en-us/azure/azure-app-configuration/rest-api-authentication-hmac

It seems that the credential and or host are invalid. However I am taking the credential straight from the App Configuration in Azure Portal, using the connection string as mentioned in all documentation. I have also tried using postman and I get the same error, even when I manually add the host to the headers.

1 Answers1

0

Thank you @stotlyakov Posting your suggestion as an answer to help other community members.

"The remedy was to make sure that the Azure tenant you were using in Visual Studio was the same as the Azure tenant you were using in Azure. Log in to the shell as az login and check which one has the "isDefault" flag set to true."

Please refer the below links for more information on similar issues:

SO THREAD: Azure App Config HMAC authentication returns Unauthorized error & Angular MSAL AD 401 Unauthorized in Angular App

GitHub: Too many calls breaks key-value

AjayKumarGhose
  • 4,257
  • 2
  • 4
  • 15