Forum Discussion

Chanakya18's avatar
Chanakya18
Copper Contributor
Oct 17, 2024
Solved

Azure Devops Yaml syntax issues

Hi All,
 
I am new to Yaml, and I am getting a syntax error with the Yaml file below.
 
The error says "/azure-pipelines.yml (Line: 7, Col: 1): While parsing a block mapping, did not find expected key."
 
-----Yaml-
trigger:
week1

poolAzure Pipelines


taskAzureCLI@2
  displayName'Running Pipeline Script'
  inputs:
    azureSubscription'MraoppingTest'
    scriptType'bash'
    scriptLocation'scriptPath'
    scriptPath'pipeline_script.sh'
  • It looks like you may have a formatting issue. Try putting single quotes around the “pool” key value as follows:

     

    trigger:
      - week1
      
    pool: 'Azure Pipelines'
    
    steps:
      - task: AzureCLI@2
      displayName: 'Running Pipeline Script'
      inputs: 
        azureSubscription: 'MraoppingTest'
        scriptType: 'bash'
        scriptLocation: 'scriptPath'
        scriptPath: 'pipeline_script.sh'

2 Replies

  • kareem_t's avatar
    kareem_t
    Copper Contributor

    It looks like you may have a formatting issue. Try putting single quotes around the “pool” key value as follows:

     

    trigger:
      - week1
      
    pool: 'Azure Pipelines'
    
    steps:
      - task: AzureCLI@2
      displayName: 'Running Pipeline Script'
      inputs: 
        azureSubscription: 'MraoppingTest'
        scriptType: 'bash'
        scriptLocation: 'scriptPath'
        scriptPath: 'pipeline_script.sh'
    • Chanakya18's avatar
      Chanakya18
      Copper Contributor
      kareem_t,
      Thanks, it was not single quotes.

      My script was missing "Steps:"

      Thanks again for your help.

Resources