title: Azure DevOps YAML self hosted agent pipeline build is stuck at locating self-agent
body: <p><strong>Action:</strong> I tried to configure and run a simple c++ azure pipeline on a self-hosted windows computer. I'm pretty new to all this. I ran the script below.</p>
  <p><strong>Expected:</strong> to see build task, display task and clean task. to see hello word.</p>
  <p><strong>Result:</strong> Error, script can't find my build agent.</p>
  <pre><code>##[warning]An image label with the label Weltgeist does not exist.
  ,##[error]The remote provider was unable to process the request.
  Pool: Azure Pipelines
  Image: Weltgeist
  Started: Today at 10:16 p.m.
  Duration: 14m 23s
  </code></pre>
  <p><strong>Info &amp; Test:</strong></p>
  <ol>
  <li><p>My self-hosted agent name is Weltgeist and it's part of the
  default agent pools.it's a windows computer, with all g++, mingw and
  other related tools on it.</p>
  </li>
  <li><p>I tried my build task locally with no problem.</p>
  </li>
  <li><p>I tried my build task using azure 'ubuntu-latest' agent with no
  problem.</p>
  </li>
  <li><p>I created the self-hosted agent following these specification.
  I'm the owner of the azure repo.
  <a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/v2-windows?view=azure-devops" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/v2-windows?view=azure-devops</a></p>
  </li>
  </ol>
  <p>How do I configure correctly the pool ymal parameter for self-hosted agent ?
  Do i have addition steps to do server side? or on azure repo configs?
  Any other idea of what went wrong?</p>
  <pre><code>
  # Starter pipeline
  # Start with a minimal pipeline that you can customize to build and deploy your code.
  # Add steps that build, run tests, deploy, and more:
  # https://aka.ms/yaml
  
  trigger:
  - master
  
  pool:
    vmImage: 'Weltgeist' #Testing with self-hosted agent
  
  steps:
  - script: |
      mkdir ./build
      g++ -g ./src/hello-world.cpp -o ./build/hello-world.exe
    displayName: 'Run a build script'
  
  - script: |
      ./build/hello-world.exe
    displayName: 'Run Display task'
  
  - script: |
      rm -r build
    displayName: 'Clean task'
  </code></pre>
  <p>(UPDATE)
  <strong>Solution:</strong></p>
  <p>Thx, after updating it as stated in a answer below and reading a bit more pool ymal definition it works. Note, I modified a couple of other lines to make it work on my environment.</p>
  <pre><code>
  trigger:
  - master
  
  pool:
    name: Default
    demands:
     - agent.name -equals Weltgeist
  
  steps:
  - script: |
      mkdir build
      g++ -o ./build/hello-world.exe ./src/hello-world.cpp
    displayName: 'Run a build script'
  
  - script: |
      cd build
      hello-world.exe
      cd ..
    displayName: 'Run Display task'
  
  - script: |
      rm -r build
    displayName: 'Clean task'
  
  </code></pre>