Search code examples
azureazure-devopsyamlazure-pipelines-yaml

Azure DevOps - basic script - echo commands failed


variables:
    yamlvar : "I'm YAML Variable"
    group : DevGroup

stages:
  - stage: DevStage
    jobs:
     - job: 2019Job
       steps:
        - script: |
          displayName: step 1
           echo $(yamlvar)
           echo $(inputvar)
           echo $(SirisJob)
     

I started practicing the YAML. Not Sure why this code is failing to run.

  • yamlvar - Initialized in the same YAML code.
  • Inputvar - given at run section.
  • Sirisjob - this variable is from the variable group saved in library.

Error: Stage DevStage job 2019Job has an invalid name.


Solution

  • Check the docs: jobs.job definition

    job string. Required as first property. ID of the job. Acceptable values: Valid names may only contain alphanumeric characters and '_' and may not start with a number.