首页 > 解决方案 > 如何在 Azure DevOps 上创建/编辑 YAML 发布管道

问题描述

我在 YAML 中有一个构建管道,它工作正常。我现在想创建发布管道。

我已经使用 UI 创建了管道并添加了一个任务(恰好是一个 AZURUE CLI 任务),当你使用 UI 将变量添加到命令中时,我得到了错误。

#Your build pipeline references an undefined variable named ‘STORAGE_ACCOUNT_NAME’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972
#Your build pipeline references an undefined variable named ‘STORAGE_ACCOUNT_KEY’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972

阅读我需要添加的文档

- variables:

部分到 YAML,但我找不到直接编辑发布管道 YAML 的位置。(构建管道 YAML 在我的代码中)

如何编辑该 YAML 发布管道?

或者,如何使用 UI 向此发布管道添加变量?

标签: azure-devopsyaml

解决方案


如何使用 UI 向此发布管道添加变量

编辑您的发布管道,您会在Variables旁边找到该选项卡Tasks

在此处输入图像描述

单击Add以添加新变量。

或者,如果您使用的是变量组:

在此处输入图像描述

如何编辑该 YAML 发布管道?

Multi-stage YAML pipelines要启用 YAML 发布管道,您需要启用Preview features

在此处输入图像描述

查看多阶段 YAML 管道以获取更多信息。


推荐阅读