user3616775
user3616775

Reputation: 85

Create service connection and use the same in next stage of azure devops multi stage yaml pipeline

I have two yaml templates defined one for creating a docker registry service connection and second for deploying some stuff via container job. The second template uses the docker registry connection which is being deployed in first template. When I am running both the templates separately then both the stages are successful but when I run them in one azure-pipelines.yaml, it fails :

There was a resource authorization issue: "The pipeline is not valid. A service connection with name shared-stratus-acr-endpoint could not be found. The service connection does not exist or has not been authorized for use. For authorization details, refer to https://aka.ms/yamlauthz."

Is there any way like dependsOn or condition that we can provide in this situation?

Upvotes: 1

Views: 1089

Answers (1)

Eric Smith
Eric Smith

Reputation: 2560

It's likely that you only authorized the service connection for the individual template\pipelines when you created them. The workflow is not super friendly.

What if you try and authorize the pipeline that is failing for that service connection explicitly. See docs here

enter image description here

You could also just authorize the service connection for all pipelines depending on your security needs.

Upvotes: 0

Related Questions