Search code examples
azure-devopsyamlazure-pipelines-yaml

YAML Implicit keys need to be on a single line, Implicit map keys need to be followed by map values


trigger:
- develop

pool:
  vmImage: windows-2019

- task: MSBuild@1
  inputs:
    solution: '**/*.sln'
- task: DownloadBuildArtifacts@1
  inputs:
    buildType: 'current'
    downloadType: 'single'
    itemPattern: '**/*.exe'
    downloadPath: '$(System.ArtifactsDirectory)'

I get an error with this YAML in both Azure DevOps and using the YAML extension for VS Code. I'm trying to build a Windows Service and then put the .exe file somewhere that I can download it.

Azure DevOps: azdo screenshot VSCode vscode screenshot

Error:

Implicit keys need to be on a single line, Implicit map keys need to be followed by map values


Solution

  • Although the error looks some what confusing, your are missing the keyword steps.

    
    trigger:
    - develop
    
    pool: 
      vmImage: windows-2019
    
    steps:
    - task: MSBuild@1 
      inputs: 
        solution: '**/*.sln'
    - task: DownloadBuildArtifacts@1 
      inputs: 
        buildType: 'current' 
        downloadType: 'single' 
        itemPattern: '**/*.exe' 
        downloadPath: '$(System.ArtifactsDirectory)'