Azure devops 如何从其他管道运行管道?
如何从多阶段管道触发管道构建? 从第一阶段到第二阶段 尝试->Azure devops 如何从其他管道运行管道?,azure-devops,azure-pipelines,Azure Devops,Azure Pipelines,如何从多阶段管道触发管道构建? 从第一阶段到第二阶段 尝试-> - task: TriggerBuild@3 inputs: authenticationMethod: 'OAuth Token' - task: TriggerPipeline@1 inputs: serviceConnection: 'need-to-create' project: 'myproject' Pipeline: 'Build' buildDefinition:
- task: TriggerBuild@3
inputs:
authenticationMethod: 'OAuth Token'
- task: TriggerPipeline@1
inputs:
serviceConnection: 'need-to-create'
project: 'myproject'
Pipeline: 'Build'
buildDefinition: 'mybuild'
Branch: 'mybranch'
它失败了:
如果使用OAuth令牌,请确保在生成定义中启用了对它的访问
尝试->
- task: TriggerBuild@3
inputs:
authenticationMethod: 'OAuth Token'
- task: TriggerPipeline@1
inputs:
serviceConnection: 'need-to-create'
project: 'myproject'
Pipeline: 'Build'
buildDefinition: 'mybuild'
Branch: 'mybranch'
失败:
设置“serviceConnection”时出错,因为只有在
“个人访问令牌”,我不想将我的个人访问令牌用于
服务目的
还有其他建议吗?当您使用OAuth令牌时,您应该以以下方式映射
系统.AccessToken
:
env:
System_AccessToken: $(System.AccessToken)
因此,在您的第一个选择中:
- task:
inputs:
authenticationMethod: 'OAuth Token'
env:
System_AccessToken: $(System.AccessToken)
我会考虑将问题改成“如何配置Azure DeVoPS中的触发器构建任务的身份验证”或类似的内容。这个问题正是我在寻找的,只是因为标题的缘故,要找到它有点困难。