Self-hosted Azure DevOps Pipeline Agent/Runner and Deployment to Different Environments

Taranjeet Malik 571 Reputation points
2025-03-11T23:52:41.6466667+00:00

Hi

We have a few Logic / Function apps protected with Private Endpoints. To deploy code to these apps, we're planning to deploy a self-hosted Azure DevOps pipeline agent / runner and seeking some clarification around it:

  1. Is it better (any preferences) to deploy it within Azure VNet Vs deploying it on-prem?
  2. Any specific operating system (Linux / Windows) preferences?
  3. Can we use same set of agents / runners to deploy to different Azure environments (DEV, UAT, PROD)? Are there any security considerations here?

Any relevant documentation would be appreciated.

Thanks

Taranjeet Singh

Azure DevOps
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Damilola Onadeinde 475 Reputation points
    2025-03-16T18:10:15.4+00:00

    Q1. It is generally recommended to place the self hosted agent within your azure vnet. This gives it better performances especially when accessing resource hosted in a private endpoint.

    Q2. The operating system to use soley depends on the type of project. Fro example, if your pipeline has to do with Windows-specific tasks like .NET Framework builds, PowerShell scripts), I would say go for windows os. For others, you can go for linux OS as it is ligher, cheaper and also supports large range of tools.

    Q3. Absolutely. You can use same set of agents to deploy to different environments, provided that they are all in the same vnet. For example, in one of my previous projects, we had prod vnet, stage vnet and dev vnet. prod does not share vnet with other environments, stage and demo shared vnet, while dev and test shared vnet. it means we had only 3 hosted agents - pod agent, stage/demo agent and dev/test agent. stage/demo agent was used to deploy to either of the two, while dev/test agent was used to deploy in either of both. no other environment shared with prod

    You can reference this article for more information https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/agents?view=azure-devops&tabs=yaml%2Cbrowser

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.