asp.net-core - 使用 Azure DevOps Pipeline 中的阶段 : Unexpected value 'stages'

标签 asp.net-core azure-devops azure-pipelines

我创建一个 Azure-Pipelines 文件,其开头如下:

pool:
  vmImage: 'Ubuntu-16.04'

trigger:
- master

variables:
  buildConfiguration: 'Release'
  buildPlatform: 'any cpu'
  version: '0.2.0'
  azureSubscription: 'Azure.Nupaya'
  azureAppType: 'Web App on Windows'
  webAppName: 'api'

stages:

- stage: 'Prepare'
  displayName: 'Prepare'

  jobs:

  - job: 'Setup'
    steps:
    - task: DotNetCoreInstaller@0
      displayName: 'Install'
      inputs:
        packageType: 'sdk'
        version: '2.2.105'

当我运行它时,我收到错误:

 Unexpected value 'stages'

Yaml 文件不支持阶段吗?

我检查了Schema在 Microsoft 文档中...

我错过了什么?

最佳答案

在使用 Azure DevOps 进行一些操作和测试后,您似乎在 job 属性下定义了,以便允许我们为不同的作业定义不同的代理池.

所以对于你的例子来说它是:

trigger:
- master

variables:
  buildConfiguration: 'Release'
  buildPlatform: 'any cpu'
  version: '0.2.0'
  azureSubscription: 'Azure.Nupaya'
  azureAppType: 'Web App on Windows'
  webAppName: 'api'

stages:

- stage: 'Prepare'
  displayName: 'Prepare'

  jobs:

  - job: 'Setup'
    pool:
      vmImage: 'Ubuntu-16.04'
    steps:
    - task: DotNetCoreInstaller@0
      displayName: 'Install'
      inputs:
        packageType: 'sdk'
        version: '2.2.105'

关于asp.net-core - 使用 Azure DevOps Pipeline 中的阶段 : Unexpected value 'stages' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55622844/

相关文章:

asp.net-mvc - 如何为未经同意的用户创建身份服务器页面?

c# - 从 wsdl 生成 c# 类

c# - 使用 # 重定向到页面中的 div

c# - ASP.NET Core API 中的常规路由

git - 无法在 Azure 中重新部署 Visual Studio Online 版本

Azure DevOps 部署到本地计算机

.net-core - VSTS Visual Studio 设置环境变量测试项目

c# - 无需用户即可访问 Azure DevOps API

azure-pipelines - 如何在 Azure Pipeline 中安装 .msi 程序 (Windows)

azure-devops - 如何解决 Unable to locate executable file : 'pwsh' . Please verify either the file path exists error when getting buildid with Azure rest API?