Azure Pipelines "Resource not authorized" (pipeline resource)
A resources: block (a pipelines: resource for cross-pipeline artifacts, or a repositories: resource) references something the pipeline is not authorized to consume. The declaration is valid but access has not been granted.
What this error means
The run fails noting the declared resource is not authorized for use, naming the pipeline or repository resource. It is an authorization gate, not a YAML error.
##[error]The pipeline resource 'upstream' is not authorized for use
in this pipeline.Common causes
Cross-pipeline/repository resource not authorized
Consuming another pipeline's artifacts or checking out another repo requires authorization for that source. A first reference is blocked until granted.
Resource name or project mismatch
The resource source:/name: must point at a real pipeline/repo the consumer can access. A wrong project or renamed source leaves it unauthorized.
How to fix it
Declare and authorize the resource
Declare the resource and authorize the pipeline to consume it.
resources:
pipelines:
- pipeline: upstream
source: build-pipeline
project: Platform
repositories:
- repository: shared
type: git
name: Platform/shared-libGrant access on first use
- Use the run's authorization prompt to permit the named resource.
- Confirm the
source/nameandprojectpoint at an accessible source. - Re-run after the one-time authorization is granted.
How to prevent it
- Authorize cross-pipeline and cross-repo resources when first declared.
- Keep resource
source/name/projectaccurate after renames. - Reference only resources the consuming pipeline can access.