azureazure-devops

Azure self hosted agent failing to pick up jobs


I am new to azure and ci/cd. I created a self hosted agent. I created the agent because I receive an error message

No hosted parallelism has been purchased or granted. To request a free parallelism grant, please fill out the following form https://aka.ms/azpipelines-parallelism-request

I was directed to create an self hosted agent. So I followed the steps and the agent is connected to the server and listening for jobs. I updated my yml file, looking at the error the new localAgentPool did pick it up. However I am getting the same error, no hosted parallelism has been purchased or granted. I do not know why I am getting that error since I am using self hosted agent. Also not sure what parallel jobs even is. In the pipeline section it has free parallel jobs 1 viewing parallel jobs it has 0/1 I don't need to run the jobs parallel. This is for a school project, I will only ever have one job running at a time.

trigger:
- main

pool:
  vmImage: localAgentPool

steps:
- script: echo Hello, world!
  displayName: 'Run a one-line script'

- script: |
    echo Add other tasks to build, test, and deploy your project.
    echo See https://aka.ms/yaml
  displayName: 'Run a multi-line script'

I thnk it's not choosing the correct pool?

Pool: Azure Piplelines Image:localAgentPool But I think it should be localAgentPool and image:localImage

I updated the yml to run without parallel but same no hosted parallelism error.

trigger:
- main

pool:
 vmImage: ubuntu-latest
 demainds:
   - parallelism: 1

steps:
- script: echo Hello, world!
  displayName: 'Run a one-line script'

- script: |
    echo Add other tasks to build, test, and deploy your project.
    echo See https://aka.ms/yaml
  displayName: 'Run a multi-line script

Solution

  • To specify the self-hosted agent pool, please use name in pipeline yaml. vmImage is only valid in the Microsoft-hosted pool.

    pool:
      name: localAgentPool          #<--- use name
    
    steps:
    - script: echo Hello, world!
      displayName: 'Run a one-line script'
    

    Add if you would like to use demands(fix the typo) to find specific agent, there is no such parallelism, you need to check the agent capability for the value.

    Please refer to the doc for more details.