Azure Managed DevOps Pools cross-contamination
09 Apr 2026
Azure DevOps (“ADO”) Managed DevOps Pool (“MDOP”) agent VMs let you privately network Azure Pipelines without having to self-host your own long-running VM, but if you set the agentProfile kind parameter to Stateful instead of to Stateless, then they wouldn’t be fully ephemeral. So you’d still have the problem that sequential workloads on the same VM could be exposed to residual state from prior runs. It’s a heck of a lot shorter VM time-to-live (“TTL”) than your average self-host – no more than 7 days – but if you set the TTL long enough, you could end up with an afternoon job still seeing an environment variable named HELLO set to world, even though it was a morning job that set that value. Cross-contamination vectors may include:
- environment variables: set by a prior pipeline run and not cleaned up
- filesystem artifacts: temp files, cached packages, build outputs, or leaked secrets written to disk
- cached credentials: tool credential caches (e.g. npm, NuGet, Docker) persisted into a VM operating system user profile
- installed software: tools installed by a prior run that may alter behavior of subsequent runs
I made a new ado-mdop-cruft-validator repo with some sample Azure Pipelines YAML in it to make it easier for you to observe inter-run residual state “cruft” if you consider “stateful” MDOPs.
This can help inform appropriate recommendation-making about mitigations such as:
- MDOP TTL tuning (cheaper and faster warmup if you go longer; more secure if you go shorter) or just going
Statelessinstead ofStateful. - Allowed usability scope for each ADO agent pool (if controllable centrally; not sure; may not be if ADO project admins can override settings?).
- That is, maybe you don’t care about cross-contamination within a given department. This’ll help you have those conversations.
- Pipeline code hygiene conventions (e.g. explicit cleanup steps) in need of widespread training.
- Monitoring and observability of what happens during pipeline runs (if available; not sure; ADO might not surface a lot?).