In Azure Devops, let's say you have three self-hosted agents that run on three different Windows Servers and they are all part of the Default agent pool. When you create a build you're only able to specify what agent pool to pull from. If your wanting to create the build to run a specific agent (windows server) where do you specify this or how does it know to grab the right agent?? If you could please provide and explanation on how this works.
Thank you
Firstly, you can add different capabilities for each of those Agents (even if they are in the same pool). Add them as User defined capabilities.
See : https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/agents?view=azure-devops&tabs=browser#configure-agent-capabilities
And then in your azure pipelines yaml, you can add that user defined capability as a demand under the pool used : https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/pool?view=azure-pipelines#pool-name-demands-vmimage
Azure will then only use an agent in that pool that matches all your demands.
According to your description, we suppose that the definition for agent pool demands of yaml schema could work for your scenario
If you are using classic pipeline editor, you could also define your self-hosted agent pools demands to specify the specific capabilities for the agents.
Related
I have working local Agent Pool (deploy) which already have 4 agents. They run ok but i need to add more agents. However i don't know the PAT that was used to create those agents.
I am now using a different account to create another agent and it is created ok. But the pipelines that are using the Agent Pool (deploy) are not picking this new agent!
Why is that?
The PAT is only used to create the agent's first auth session. Afterwards it sets up a new secure token.
You can setup agents with as many PATs as you'd like.
Hello I would like to get all machines available in a specific environment and use them as a parameter in the YAML pipeline (e.g. I've got 20 machines and I would like to get them all and see available to choose from when I run the pipeline)
Is there possibility to get all virtual machines available in Azure DevOps environment?
The answer is yes.
To see available to choose those 20 machines from when you run the pipeline, you need to create private agent pool for those 20 machines.
As you can see from the azure pipeline:
We can see that the option to choose from is agent pool. So, if we want get those 20 machines all and see available to choose from when you run the pipeline, you need to create a private with a private agent pool on each machine. In this case, you will get those 20 machines all and see available to choose.
You could check the document Self-hosted agents for some more details.
It's also possible to create a self hosted agent in Kubernetes cluster.
https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/docker?view=azure-devops
It's easier to manage and Autoscaler
In the ADF Self Hosted integration runtime, I have two nodes. Can I choose one IR node as the main and the other as secondary? If there is a third one, can I choose the order in which each one is picked? I could use low tier VMs for second and third hence the question.
I think we cannot,the nodes of the self-hosted integration runtime in ADF will automatically switch when one node stops. We can reference this article to setting up Self-Hosted IR HA enabled. But the role of the node is automatically switched.
After that, we can run a test.
At first, Self-Host is a Dispatcher/worker role.
When I stop Self-Host manually, we can see Selft-Host2's role switched to Dispatcher/worker automatically.
I'm using Azure DevOps pipelines and for 'builds' I can define 'Hosted Ubuntu' agent (in my pipelines.yml file). But for 'releases' there's no way to edit yaml just the UI. The agent pool drop down list shows 'Default (no agents)'. I assume my problem is probably related to project permissions but haven't figured out what controls the visibility. On another account I see all the hosted agent options available.
For the possible security permissions issue
Check that you are part of the group(s) assigned as User to the security of the app pool in question.
If this security operates like other Allow, Deny, NotSet permissions, then your occupation in a group that has less than User permission will revoke that permission, but I haven't seen any documentation about this.
For the use of YAML in release pipelines
Yaml usage in the formal release pipeline hub is not supported. If you want to use yaml for your CD release, you're going to need to enable the new multi-stage pipelines experience.
This allows you to create stages in your .yml file that relate to deployment functions in addition to the classic build functions.
I believe this removes your release tracking from the release hub and integrates it directly into the build hub.
This is still a new concept for Azure DevOps, as is the documentation and writing about it. I found this article to be helpful.
Because this new feature seems to be centered around AKS (or other Kubernetes services) and Docker, I'm not sure if this will help you by allowing you to specify the host in yaml, but you mentioned "release" and "yaml" in the same sentence, so I thought I would address that.
I'm in the process of setting out Azure Devops for our organisation and although I have got things working to an extent, I still dont understand a couple of concepts that I think I should.
I have set up a Deployment Pool (Organization settings > Deployment Pools) and used the script to install and configure the Agents on my Dev, Test and Prod servers, and have been successfully able to deploy code to them
I have been able to build my projects using the Azure Hosted option for now, but I would really like to use the locally hosted option, but when looking at the Agent Pools(Organization settings > Agent Pools) I can only see my Production server and it wont let me use that build with. I clicked the button to "Download Agent" but it downloads the agent I already set up in the Deployment Pool stage using the same powershell command .config.cmd command
So as far as I can tell, there is no difference between an agent in an "Agent pool" vs a "Deployment pool", but I'm obviously missing something here as I cannot see the agent in the Agent pool.
Can anyone help me to understand what I might have missed, and why there are two totally different ways of downloading the same agent?
Many thanks!
Deployment pool are for deployment groups are a special agent configuration that are used specifically in release pipelines. They give some additional options for your release pipelines beyond the regular agents.
Deployment groups:
Specify the security context and runtime targets for the agents. As you create a deployment group, you add users and give them appropriate permissions to administer, manage, view, and use the group.
Let you view live logs for each server as a deployment takes place, and download logs for all servers to track your deployments down to individual machines.
Enable you to use machine tags to limit deployment to specific sets of target servers
It leverages the same pipeline agent but you are just specifying different configuration for the initialization. If you navigate to the Agent Pool page, there is a download link there with the configuration for setting up an agent that you can leverage in a build pipeline or in a release pipeline when you use an Agent Phase instead of a Deployment Group phase.