1
votes

Is it possible to clone or copy an Azure Pipeline Hosted Agent for use as a Self-Hosted Agent? I'd like to reuse one of the Hosted Agents simply to enable me recreate and reuse all of its capabilities, saving me the headache. Is this possible and if so I'd really appreciate some help.

Thanks

2
Hi hitman126, Do you have any other concern about this? If my reply helped, appreciate for marking it as an answer which will also help others in the community.PatrickLu-MSFT

2 Answers

2
votes

This is not possible, but you can try to reuse what is already available here https://github.com/actions/virtual-environments

This repository contains the source used to create the virtual environments for GitHub Actions hosted runners, as well as the VM images of Microsoft-hosted agents used for Azure Pipelines. To file bug reports, or request that tools be added/updated, please open an issue using the appropriate template. To build a VM machine from this repo's source, see the instructions.

So you can use the same scripts which are used to create Microsoft Hosted agents.

1
votes

There is no such build-in feature.

  • Azure DevOps provides free hosted agents that have a predefined set of tools installed and configured for building and releasing your apps.
  • There is another option where you set up and manage your own agents. This can be done by simply downloading the agent package, and run it either on your local machine or any other computing platform even on Docker container. It also gives you more freedom to install specific dependencies for your build and release.

If you want to build your own agent during the pipeline. I would suggest you use Docker container to handle the process.

Microsoft has already created pre-configured container images on Docker Hub for everybody to use. But they’re Linux based and don’t contain any additional applications and/or packages so you’d probably still need to add those every time you run your build.

This repository contains images for the Visual Studio Team Services (VSTS) agent that runs tasks as part of a build or release.

VSTS agent images are tagged according to the base OS, an optional Team Foundation Server (TFS) version, and tools that are installed.

When used with VSTS, the agent version is automatically determined and downloaded at container startup based on the account to which the agent is connecting.

More detail step, you could refer this article: Build your own Azure DevOps agents with pipelines