No hosted parallelism has been purchased or granted Error.
When creating a pipeline in your DevOps some users might get the above error.
Well, there are 2 ways to get rid of it, if one has 2–3 working days of time I recommend raising a request on aka. ms/pipelines-parallelism-request, or else one can create a self-hosted agent.
In this article, we are going to see how to create a self-hosted agent (on your personal system or even on a Virtual Machine).
Simply navigate to your organization settings “Agent pools” > Default> New Agent> Download agent which meets your configuration.
Downloading Agent
Once the agent is downloaded, run PowerShell as admin navigate to C Drive, and run the 1st command i.e. mkdir agent; cd agent.
This will simply create a directory with the name agent and navigate you to the folder.
Now run the 2nd command which will extract the downloaded files in your agent folder.
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory(
"$HOME\Downloads\vsts-agent-win-x64-3.243.0.zip",
"$PWD"
)
Extracted Files
- Now run the other commands i.e.
.\config.cmd
- Now this will ask you for the server URL, which is nothing but your organization URL: https://azure.microsoft.com/en-us/products/devops/?nav=min.
- Now you will have to enter the authentication type, in this case, we will be using a personal authentication token (PAT), so click enter.
- To create a personal access token, at the top go to user settings and click on Personal access tokens, create a new token, give a suitable name to your token, grant full access, and create the token.
- Copy the token and paste it into the Windows Powershell and hit enter.
- Powershell will ask for the agent pool name and agent name, in this scenario the agent pool name is default and the agent name is the system name, so hit enter.
- Now Powershell will ask for the folder path, Enter the path where all your files will be placed and hit enter.
- Later powershell will ask to run the agent as a service In this case we do not want to configure this as a service, so hit enter.
Configuring Pipelines
Now navigate to organization settings > Agent Pools > Default > Agents, you can see currently your agent is currently in an offline state.
Agent status
In order to start the agent, run the run command in your agent folder. So in Powershell run the below command.
.\run.cmd
Now you can see your server is listening for the jobs now. Also, the agent will be online now.
Run command
- Now in order to link your agent with the pipeline go to “Project Settings” > Agent pool. Select the agent pool and go into the Security tab.
- Either click the “+”-button to grant permission for specific pipelines or click the “three dots”-button and select “Open access” to grant all pipelines in the project permission to use the agent pool.
- Now run the pipeline and you can see the error is no more:)
Note. Some errors one can encounter when setting pipelines.
No Agent was found in the default pool
To resolve the above error, I had to install Visual Studio Community 2022 on my machine, restart the Machine, and after restart I was able to see the below capabilities in “Organization Settings” > “Agent Pools” > “Default” > “Agents” > “Your Agent” > “capabilities”
Agent Capabilities
Once the above capabilities are visible, run the pipeline again.