title: Can't run a templated yaml Azure Devops pipeline with dynamically created stage
body: <p><strong>My problem</strong></p>
  <p>I try to create templated yaml Azure Devops pipeline:</p>
  <pre><code>parameters:
  - name: envs
    type: object
    default:
      -  QUAL
      -  PROD
      -  PREPROD
      
  stages:
  - template: Orchestrator.yml
    parameters:
     name: envs
     type: object
     default:
        -  QUAL
        -  PROD
        -  PREPROD
  </code></pre>
  <p>This is my template:</p>
  <pre><code>parameters:
   envs: {}
  
  stages:
  - ${{ each env in parameters.envs }}:
    - stage: ${{ env }}
      jobs:
      - job: Deploy
        steps:
          - script: echo Deploy project
            displayName: 'Deploy'
      - job: Tests
        steps:
         - script: echo Unit tests
           displayName: Test 1
  </code></pre>
  <p>But I get this error message:</p>
  <blockquote>
  <p>An error occurred while loading the YAML build pipeline. The array
  must contain at least one element. Parameter name: stages</p>
  </blockquote>
  <p>OK, I modify my main script like this:</p>
  <pre><code>parameters:
  - name: envs
    type: object
    default:
      -  QUAL
      -  PROD
      -  PREPROD
      
  stages:
  - stage: Build
    jobs:
    - job: Build
      steps:
         - script: echo Compilation completed...
           displayName: 'Compile'
  
  - template: Orchestrator.yml
    parameters:
     name: envs
     type: object
     default:
        -  QUAL
        -  PROD
        -  PREPROD
  </code></pre>
  <p>This time pipeline runs, but only first Job. The Template is not loaded.</p>
  <p><strong>What I need</strong></p>
  <p>I was able to make this scenario working with a single file script, but I would like to make it working with a templated script.</p>
  <p>Is this scenario supported? How I can do?</p>
  <p>thanks</p>