receive This error "unauthorized: Invalid clientid or client secret." while trying to run Pipeline

Alaa Farouk 0 Reputation points
2025-04-07T09:06:47.2+00:00

receive This error "unauthorized: Invalid clientid or client secret." while trying to run Pipeline

Azure Container Registry
Azure Container Registry
An Azure service that provides a registry of Docker and Open Container Initiative images.
511 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Abiola Akinbade 29,490 Reputation points Volunteer Moderator
    2025-04-07T09:39:59.94+00:00

    The issue that generates this service principal alert usually occurs for one of the following reasons:

    • The client secret expired.
    • Incorrect credentials were provided.
    • The service principal doesn't exist within the Microsoft Entra ID tenant of the subscription.

    Please verifiy the above. To do this:

    Go to Azure Portal > Entra> App registrations

    Find the app (by Client ID)

    Go to Certificates & Secrets and confirm the secret exists or it has correct permissions

    az ad app credential list --id "$SP_ID"
    

    To check the service principal.

    Once this is confirmed You need to add the new secret you created in entra id to the service connection in azure devops

    You can mark it 'Accept Answer' and 'Upvote' if this helped you

    Please note: If you have Priority Community support please wait for a dedicated Microsoft support representative to assist you, as they have access to the necessary backend resources.

    Regards,

    Abiola

    0 comments No comments

  2. Anusree Nashetty 4,635 Reputation points Microsoft External Staff Moderator
    2025-04-08T13:25:13.97+00:00

    Hi Alaa Farouk,

    Run the following command to verify if the service principal password is correct: Verify and correct the password of service principal.

    az login --service-principal --username $sp_id --password $sp_secret --tenant $ten_id
    

    You can also try changing to a new service connection.

    For your reference: Pull and Push Docker Image task to ACR fails in Azure Devops Pipeline "unauthorized: Invalid clientid or client secret."

    Please let us know if you have any further queries. I’m happy to assist you further.

    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.