Search code examples
azureazure-devopsazure-pipelinesazure-pipelines-release-pipelineazure-rm-template

PRODConfirmInvitationCode: "Could not fetch access token for Azure. Status code: 401, status message: Unauthorized"


When doing deploy from Azure DevOps to azure subscription and getting error:

Download secrets:

PRODConfirmInvitationCode: "Could not fetch access token for Azure. Status code: 401, status message: Unauthorized" PRODSendInvitationCode: "Could not fetch access token for Azure. Status code: 401, status message: Unauthorized" PRODValidateInvitationCode: "Could not fetch access token for Azure. Status code: 401, status message: Unauthorized" PRODLehisoGraphEnabledClientId: "Could not fetch access token for Azure. Status code: 401, status message: Unauthorized" PRODLehisoGraphEnabledClientSecret: "Could not fetch access token for Azure. Status code: 401, status message: Unauthorized" PRODOticonGraphEnabledClientId: "Could not fetch access token for Azure. Status code: 401, status message: Unauthorized" PRODOticonGraphEnabledClientSecret: "Could not fetch access token for Azure. Status code: 401, status message: Unauthorized" PRODConfirmPasswordReset: "Could not fetch access token for Azure. Status code: 401, status message: Unauthorized" PRODSendPasswordReset: "Could not fetch access token for Azure. Status code: 401, status message: Unauthorized" PRODValidatePasswordReset: "Could not fetch access token for Azure. Status code: 401, status message: Unauthorized"


Solution

  • Source of error is that secret for service principal have expired so solution is to renew service principal key with can be done manual or automated.

    enter image description here

    enter image description here