azure-pipelines-tasks: [BUG]: AzureCLI@2 az login fails when using certificate for authentication starting from version 2.67.0 of Azure CLI

Starting from version 2.67.0, for az login, --password no longer accepts service principal certificate. Use --certificate to pass a service principal certificate. AzureCLI@2 does not use the --certificate parameter to pass the service principal certificate resulting in: ERROR: AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app '***'. The error may be caused by passing a service principal certificate with --password. Please note that --password no longer accepts a service principal certificate. To pass a service principal certificate, use --certificate instead.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 11
  • Comments: 17 (4 by maintainers)

Most upvoted comments

@v-schhabra Can someone please look at https://github.com/microsoft/azure-pipelines-tasks/issues/20722 ? We need some traction please.

@robkendrick - What you said is partially a workaround. It doesn’t work out for MSPs since one app registration can only have 20/30 federated credential. Whenever you create a service connection it will take up one federated credential. Let’s say if someone wants to manage multiple tenants then it wouldn’t work because of restriction on the number of federated credential an app registration can have. @v-schhabra Does MS have any updates? This needs to be fixed ASAP! This is breaking production setup

As a workaround, adding this task should help on windows host

 - powershell: |
    wmic product where "name='Microsoft Azure CLI (64-bit)'" call uninstall /nointeractive
    Invoke-WebRequest -Uri https://azcliprod.blob.core.windows.net/msi/azure-cli-2.66.0-x64.msi -OutFile .\AzureCLI.msi; 
    Start-Process msiexec.exe -Wait -ArgumentList '/I AzureCLI.msi /quiet';
  displayName: Downgrade azure CLI

This is breaking user pipelines on our side, this should be fixed asap.