Facing authentication error with manageIdentity for resource https://api.loganalytics.io/ on azure dev ops pipeline

Saransh Gaur 40 Reputation points Microsoft Employee
2024-07-30T06:09:00.0133333+00:00

I am working on the validation of an Azure query using logQueryClient, which requires credentials to initialize. When I perform interactive authentication on my local machine, it works fine. However, when I use managed identity-based authentication in the pipeline, I encounter the following error:

"Query validation failed: (InvalidTokenError) The provided authentication is not valid for this resource

Code: InvalidTokenError

Message: The provided authentication is not valid for this resource

Inner error: {

    "code": "InvalidAuthenticationTokenTenant",

    "message": "The access token is from the wrong issuer 'https://sts.windows.net/124edf19-b350-4797-aefc-3206115ffdb3/'. It must match the tenant 'https://sts.windows.net/***/' associated with this subscription. Please use the authority (URL) 'https://login.windows.net/***' to get the token. Note, if the subscription is transferred to another tenant there is no impact to the services, but information about new tenant could take time to propagate (up to an hour). If you just transferred your subscription and see this error message, please try back later."}"

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,645 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.