Could not fetch access token for Managed Service Principal

Nikhil Pandey 0 Reputation points
2023-07-21T02:53:37.8233333+00:00

Hi,

I am trying to create a release and while deploying it on Web App (Windows), i am getting error

Failed to get resource ID for resource type 'Microsoft.Web/Sites' and resource name 'AzureDevops-App'. Error: Could not fetch access token for Azure. Status code: 400, status message: Could not fetch access token for Managed Service Principal. Status code: 400, status message: Bad Request

The have created a service connection for my subscription and then calling it during Azure pileline release, but i get this error everytime.

I am very new to Azure Devops and a total novice and need a help on how can i resolve this query

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
41,933 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 22,181 Reputation points
    2023-07-21T07:11:46.2333333+00:00

    @Nikhil Pandey

    For the error message you are receiving

    Failed to get resource ID for resource type 'Microsoft.Web/Sites' and resource name 'AzureDevops-App'. Error: Could not fetch access token for Azure. Status code: 400, status message: Could not fetch access token for Managed Service Principal. Status code: 400, status message: Bad Request

    This is caused by the authentication token is invalid or expired, you may try to Authorize a new connection.

    Also see this similar query here might be helpful-

    Fix Azure DevOps TF14045 Error When Deploy to Azure

    Also, you may want to know that Azure DevOps is not supported on Microsoft Q&A. Please check this supported products list here.

    The Azure DevOps team and community are active and answering questions on https://developercommunity.visualstudio.com/spaces/21/index.html suggest you post your question there and experts will guide you.

    Please "Accept as Answer" if it helped so it can help others in community looking for help on similar topics.

    0 comments No comments

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.