创建服务连接并在Azure Devops多阶段Yaml管道的下一阶段中使用该服务连接

时间:2020-02-08 22:37:06

标签: azure-devops azure-devops-rest-api multistage-pipeline

我定义了两个Yaml模板,一个用于创建Docker注册表服务连接,另一个用于通过容器作业部署某些东西。第二个模板使用正在第一个模板中部署的Docker注册表连接。当我分别运行两个模板时,两个阶段都成功,但是当我在一个azure-pipelines.yaml中运行它们时,它失败了:

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."

在这种情况下,我们可以提供诸如dependsOncondition之类的任何方式吗?

1 个答案:

答案 0 :(得分:0)

您创建模板/管道时,可能仅授权了它们的服务连接。工作流程不是超级友好的。

如果您尝试明确授权对该服务连接失败的管道该怎么办。参见docs here

enter image description here

您还可以根据您的安全需要授权所有管道的服务连接。