在Azure DevOps管道中将变量从Python传递到YAML

2024-09-27 09:37:43 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图将一个变量值从Python脚本传递到一个YAML文件中,以便在Azure开发人员Ops管道上运行。我在YAML文件中使用以下代码:

- bash: |
studentName=$(sed -i {/$deploymentResult.properties.outputs.studentName.Value/'a\}' "/CreateEnvironment.ps1")
echo "##vso[task.setvariable variable=studentName]studentName"
echo "##vso[task.setvariable variable=outputstudentName;isoutput=true]studentName"

但是当在应用程序服务名称中使用变量studentName时,我从pipepline中得到一个错误:error:无法获取应用程序服务“studentName”详细信息

有人知道关于AzureDevOps管道以及如何做到这一点吗

请不要只是发布Microsoft到Azure DevOps材料的链接,我已经仔细看过了


Tags: 文件代码echo脚本应用程序yamltask管道

热门问题