PATH Not Persisting in Azure DevOps Agent (VMSS) Despite Image Configuration Body: #5265
Unanswered
sharmila1310
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi team,
I'm trying to persist a custom tool path (/usr/local/MATLAB/R2025a/polyspace/bin) across Azure DevOps pipeline runs using a VMSS-based agent. The goal is for this path to be available to the pipeline agent without redefining it inside the pipeline YAML every time.
What I’ve Tried:
I've baked the required path into the image using the following approaches:
Updated during image build to include the custom path. But the path does not appear in the agent's environment during pipeline runs.
Works if manually sourced in the YAML pipeline, but doesn’t persist automatically.
Not applicable — DevOps agent doesn’t run as a login shell.
Added:
[Manager]
DefaultEnvironment="PATH=/usr/local/MATLAB/R2025a/polyspace/bin:..."
But it’s not picked up by the agent process — possibly because the agent is installed after image capture via VMSS extension.
Created a script that waits for the vsts.agent.*.service to appear, then writes a drop-in override. This failed (agent not ready yet).
Delays script for 5–30 minutes post-boot. Still unreliable — PATH not updated in pipeline runs.
Temporary Workaround
I’ve used the following in the pipeline YAML, which does work, but isn’t a persistent solution:
echo "##vso[task.setvariable variable=PS_BIN;isOutput=true]/usr/local/MATLAB/R2025a/polyspace/bin"
What I Need Help With:
What’s the correct/preferred method to:
Persist a custom PATH in the VM image
Ensure its applied to the Azure DevOps agent (running via VMSS)
Without having to redefine or source paths inside every pipeline
If there’s a way to hook into the VMSS agent install process or inject environment during provisioning, I’d love to explore it.
Beta Was this translation helpful? Give feedback.
All reactions