I am creating a self-hosted Windows agent on my on-premises server. After successfully installing and running the agent service, I noticed that I am unable to see the PATH variable in system capabilities of the newly created agent (see image below).
I wish to have the PATH variable since the PATH variable contains the directories of certain batch files/programs that should run when my pipeline (which is using this agent) is triggered. Currently, when I trigger the pipeline, it tells me that my batch file is not recognised as an internal or external command, operable program or batch file. I think the error occurs because the PATH variable is not listed in the capabilities of the agent.
I followed the steps as outlined in this Microsoft page. I am wondering whether I made a mistake in the installation process, so I will outline the steps I took.
During the installation process, the following questions were prompted:
to which I answered:
Here is the information that I can provide about the Agent itself:
Agent.Version: 3.225.0
Agent.HomeDirectory: D:\BuildAgent
Agent.OS: Windows_NT
Agent.OSArchitecture: X64
Agent.OSVersion: 10.0.20348
1. Different configuration options
I tried with the following configuration options as well (after removing and re-installing).
The PATH variable still does not show up after this.
2. Different Agent Version
I did notice that the the agent version I am using is 3.225.0 but the one mentioned in the guide says 2.X. So, I went over to the Release Page for Azure Pipelines Agent and installed the older v2.220.0 version of the agent. But, I still do not see the PATH variable even after doing this.
3. Restarting the server
I came across this page where one of the suggested solution was to restart the machine. I tried that, but the problem still persists.
Lastly, I found this page where it is stated that variables stored inside the VSO_AGENT_IGNORE
environment variable will not be added to the capabilities of the agent. I did not add PATH to this environment variable during the installation, but I am unsure if the PATH variable is inside by default. I am also unsure on how to check for the value of the VSO_AGENT_IGNORE
environment variable.
In addition, in case it helps, here are the OS details of my server:
Edition: Windows Server 2022 Standard
Version: 21H2
OS build: 20348.587
Even if it's not being displayed in the agent capabilities, the PATH
environment variable tells Windows where it can find specific directories that contain executable files.
If the PATH
is changed (e.g. when a new tool is installed) and an agent is already running, restart the agent to ensure that it can pickup all configuration changes.