service connection could not be found 🔷 Azure

Azure Pipelines: There was a resource authorization issue: The pipeline is not valid. Could not find a service connection with identifier x

The pipeline references a service connection that doesn’t exist in the project or isn’t authorized for this pipeline.

Seen on: Azure

Meaning

Service connections are per project and must be authorized per pipeline (or “Grant access permission to all pipelines”). Names are case-sensitive and must match azureSubscription/connectedServiceName.

Common causes

  • Service connection name typo or in another project
  • Not authorized for this pipeline
  • Connection deleted or renamed
  • Workload identity federation not set up

⚡ Quick fix

  1. Check the name in Project settings → Service connections
  2. Authorize it for the pipeline (first run prompt or security settings)
  3. Share it with the project if it lives elsewhere

Detailed fix by platform

YAML

  1. bash
    - task: AzureCLI@2
      inputs:
        azureSubscription: 'sc-prod-oidc'   # exact service connection name
        scriptType: bash
        scriptLocation: inlineScript
        inlineScript: az account show

How to diagnose

  1. Name — Exact match?
  2. Authorization — Pipeline permissions on the connection

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.