You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure Pipeline验证失败:acr-login.yaml含意外值'steps'

解决Azure Pipeline报错“acr-login.yaml中存在意外值'steps'”

问题原因

你在pipeline.yaml的jobs节点下直接引用了步骤(steps)模板,但jobs节点要求的是作业(job)模板结构,两者层级不匹配,导致Pipeline解析时识别到不符合预期的steps字段,触发验证错误。

解决方案(二选一)

方案1:将acr-login.yaml改为作业模板

修改acr-login.yaml,给步骤套上作业层级的结构:

parameters:
  - name: registry_name
    type: string
jobs:
  - job: ACRLoginJob
    steps:
    - bash: |
        az login --identity --output none
        az acr login --name ${{ parameters.registry_name }} --output none

方案2:在Pipeline的作业内引用步骤模板

保持acr-login.yaml的步骤模板结构不变,修改pipeline.yaml,先定义作业,再在作业的steps里引用模板:

trigger: none
pool:
  name: MyPool
variables:
  - template: vars/global.yaml
  - template: vars/stage.yaml

stages:
  - stage: Import
    jobs:
      - job: ImportJob
        steps:
          - template: steps/acr-login.yaml
            parameters:
              registry_name: ${{variables.registry_name}}

内容的提问来源于stack exchange,提问作者lordisp

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.20 13:33:33