Search code examples
azure-devopsyamlazure-pipelinesazure-cli

Azure cli cant connect due to Invalid client secret provided


Pipeline error code AADSTS7000215- Invalid client secret is provided. however, the client secret provided is correct because when I run the script locally and provide client secret in .env file it runs. However, creating a yaml file with azurecli I get the error.

- task: AzureCLI@2
  inputs:
    azureSubscription: 'Subscription'
    scriptType: 'pscore'
    scriptLocation: 'inlineScript'
    inlineScript: 'python script.py'
    workingDirectory: 'workingdirectory'

Full 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


Solution

  • Client secret error might be related to service connection you use. Did you verify that service connection and related SPN are properly configured?