Resources

Azure Pipelines

A resource is anything used by a pipeline that lives outside the pipeline itself. Examples include:

Some resources must be authorized before they can be used. This ensures that only users with sufficient permissions can access potentially sensitive resources such as service connections.

Resource authorization

When you save a pipeline, resource authorization checks for new and updated resources. If you lack permission to authorize one or more resources, then saving the pipeline will fail.

If you add a new resource to an existing YAML pipeline, Azure Pipelines will pick up the change but may not be able to authorize resources. Your builds may fail until you authorize resources using the troubleshooting steps below.

Troubleshooting authorization for a YAML pipeline

When you add a new service endpoint or other resource to a pipeline, it must be authorized before it will work. Authorization happens when you save the pipeline (not the YAML file, but the pipeline configuration in Azure Pipelines).

If builds fail with an error message about resource authorization, you need to re-save your pipeline. When you add a new resource in a branch other than the one you set up in Azure Pipelines, follow these steps:

  1. Navigate to the pipeline in Azure Pipelines.
  2. Switch the pipeline's default branch to the branch that includes the new service endpoint reference. For example, if you've made a change in a branch called features/add-resource, then switch the pipeline's default branch to features/add-resource.
  3. Save the pipeline.
  4. Revert back to the prior default branch and save the pipeline again.

Why does this fix it?

The act of saving the pipeline loads the file from the default branch and authorizes discovered resources. We're working on a better experience that won't require these steps.