0
votes

The azure agent is usually used as follows, it is named as pool and with a VM image title

pool:
  vmImage: 'ubuntu-16.04'

Can a hosted agent in azure DevOps service be considered as a container in VM managed by azure DevOps service?

2

2 Answers

1
votes

Can a hosted agent in azure DevOps service be considered as a container in VM managed by azure DevOps service?

Restrictly to say, no, you can not.

The key words of vmImage not point to a container, it just an image of a virtual machine, a copy of the VM. This copy contain an OS, data files, and some built-in applications we pre-configured to facilitate user use.

If you want to do some Container jobs along with Hosted agents, here the suggestion of Eldho is available. Note: As of today, the container jobs only support YAML pipeline.

Or, you can get our containerized agents image from Docker hub. But this is a self agent type.

1
votes

Your Yaml will be run on VM

Azure pipelines can run in VM or container.
Each time you run a Azure pipeline, you get a fresh virtual machine. The virtual machine is discarded after one use. Microsoft-hosted agents can run jobs directly on the VM or in a container.

A container Yaml

pool:
  vmImage: 'ubuntu-16.04'

container: ubuntu:16.04

steps:
- script: printenv

This tells the system to fetch the ubuntu image tagged 16.04 from Docker Hub and then start the container. When the printenv command runs, it will happen inside the ubuntu:16.04 container.