Why does this “No Hosted Parallelism Has Been Purchased or Granted” issue occurs when we try to build the pipeline that we created in Azure? This happens when you create your Azure DevOps pipeline for the first time. The error message “No Hosted Parallelism has been purchased or granted” indicates that your Azure DevOps organization or project does not have sufficient parallel jobs available for the pipeline to run. Azure DevOps provides parallel jobs for running multiple pipelines or jobs concurrently, and these parallel jobs are limited based on your subscription plan. I encountered this issue when I tried to build my React Native app using the Azure pipeline. To fix this you can run the Azure Pipeline agent on your computer(macOS or Windows) and run the pipeline on a self hosted Azure Pipeline Agent. Here we are going to create a self-hosted macOS agent and try to run our pipeline.
For this, we will do this step by step. First, we have to create a React Native project. I have chosen Azure Repos to push my React Native code. You can choose Azure Repos, Bitbucket, or Github when you are trying to create a new pipeline from Azure.
I am assuming that you have pushed your code to Azure, Github, or Bitbucket and you have encountered this issue when trying to build the pipeline for your branch. When you try to run the pipeline for the first time you will see something like this.
To fix this let’s see how we can create a self-hosted Azure pipeline agent.
Steps To Fix “No Hosted Parallelism Has Been Purchased”
Here we are going to create a macOS agent.
Step 1
Sign In to your Azure Organization. It’s something similar to this. https://dev.azure.com/{yourorganization}
Step 2
Navigate to Project Setting as Shown in the below. You can find it at the bottom of the Azure DevOps organization
After clicking on the project settings you can see the project settings UI and click on the Agent Pools under the Pipeline section. You can see the Pools that are already there.
Step 3
Here by default, we can see Azure Pipelines and Default Agent pools. MyPool is one that I have created. So you can click on Default Azure pool agent.
Step 4
Navigate to the Agent tab. As we don’t have any self-hosted agents this tab data is empty. Click on the New Agent button to create a new agent and you will see a modal popup with instructions to create a new self-hosted agent on your device. (macOS, windows, etc).
The above configurations are for Mac OS. If you are on Windows you will see the instructions for Windows.
Step 5
Creating a Self-Hosted Agent in Your Device
First, you have to download the Agent to your device. Then You have to create the Agent folder in your root device and extract the agent that we have downloaded to the downloads directory. Those instructions can be seen in Step 4 – creating the agent. You can run these commands in your root folder
Here I have changed the folder name to myagent-1 as I already have the myagent folder that I created earlier. You can go ahead with the exact instructions provided by Azure DevOps.
tar zxvf ~/Downloads/vsts-agent-osx-x64-3.238.0.tar.gz
This command does the extracting of the agent to your agent folder. Then the next step is to configure the Agent.
Step 6
To configure the agent we need to run a command which is ./config.sh
.
Here you have to give end-user license agreements to YES and you have to add your Server URL and authentication Type(for me it’s Personal Access Token – PAT) and your Personal Access Token. Then after configuring these, you have to configure your agent by giving the pool name that you have selected. We have selected the ‘Default‘ pool name in Azure DevOps. So I have given the name as Default. Then you have to give an agent’s name. I have given “mac-agent“. Then it will automatically add the agent to the Default pool. Finally, you have to configure the work folder you can press Enter for that.
As the final step you have to run the agent by running the ./run.sh
in the agent folder that you have created. Then the agent will connect to your server and it will listen for jobs(eg: pipeline build).
Once the agent connection is successful after running the agent you can see Listening for jobs.
Step 7
This is the final step that we have to do. Go to your code editor and edit your pipeline. You have to edit the pool name only. Add Default as your pool name.
pool: Default
After doing this one-line change again commit and push the change to the repo and see. Now you should be able to see the pipeline is building.
The above steps show how we can fix the issue “no hosted parallelism has been purchased or granted”.
Things to remember when fixing “no hosted parallelism has been purchased”
- The pipeline.yml file must have proper indentation before you proceed to build using Azure DevOps.
- Make sure to run the agent before building with Azure DevOps. Sometimes agents can be in an offline state. You can check that from Project Settings >> Agent Pools >> {Pool Name} >> Agents Tab. If the agent is offline exitthe current command line and navigate to the agent folder again in the root directory and run the agent using
./run.sh
. - All these commands are triggering the folder that you have created ‘myagent‘.
Errors Facing when creating agent with Mac OS.
This is an error that I have faced during agent creation. You can see a popup with this error “Agent.Listener” can’t be opened because Apple cannot check it for malicious software. I have encountered this error on agent configuration using the command ./config.sh
.
You can fix this easily by using a sudo command. You have to be in the agent folder for the same fix. If the configuration fails type sudo spctl --master-disable
on the command line and then configure the agent and run the agent. After that, you can change the pool name as we discussed above in the yml
file push the changes, and see the pipeline build in Azure DevOps. After the pipeline is built successfully you can enable the master again by sudo spctl --master-enable
command.
In conclusion, I can say that I have covered all the areas for creating a self hosted Azure pipeline agent. If you have any questions feel free to contact me via [email protected].
8 comment(s)
Stella Stanfill
Great site with quality based content. You've done a remarkable job in discussing. Check out my website FQ4 about Thai-Massage and I look forward to […] Read MoreGreat site with quality based content. You've done a remarkable job in discussing. Check out my website FQ4 about Thai-Massage and I look forward to seeing more of your great posts. Read Less
Article Sphere
It appears that you know a lot about this topic. I expect to learn more from your upcoming updates. Of course, you are very much […] Read MoreIt appears that you know a lot about this topic. I expect to learn more from your upcoming updates. Of course, you are very much welcomed to my website Article Sphere about Poisoning. Read Less
Articleworld
Having read your blog, you obviously know what you are talking about. I'm sure visiting my page Articleworld about Information Technology will be worth your […] Read MoreHaving read your blog, you obviously know what you are talking about. I'm sure visiting my page Articleworld about Information Technology will be worth your time! Read Less
Articlecity
This was a very good post. Check out my web page Articlecity for additional views concerning about Gemstones.
Autoprofi
Having read your blog, you obviously know what you are talking about. I'm sure visiting my page Autoprofi about Used Car Purchase will be worth […] Read MoreHaving read your blog, you obviously know what you are talking about. I'm sure visiting my page Autoprofi about Used Car Purchase will be worth your time! Read Less
ArticleHome
Great site with quality based content. You've done a remarkable job in discussing. Check out my website ArticleHome about Bitcoin and I look forward to […] Read MoreGreat site with quality based content. You've done a remarkable job in discussing. Check out my website ArticleHome about Bitcoin and I look forward to seeing more of your great posts. Read Less
Seoranko
Superb layout and design, but most of all, concise and helpful information. Great job, site admin. Take a look at my website Seoranko for some […] Read MoreSuperb layout and design, but most of all, concise and helpful information. Great job, site admin. Take a look at my website Seoranko for some cool facts about Martial Arts. Read Less
Felix Meyer
Your posts in this blog really shine! Glad to gain some new insights, which I happen to also cover on my page. Feel free to […] Read MoreYour posts in this blog really shine! Glad to gain some new insights, which I happen to also cover on my page. Feel free to visit my webpage Webemail24 about Website Design and any tip from you will be much apreciated. Read Less