The Issue
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.
Steps I performed for the installation of the service
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:
- Enter server URL:
- Enter authentication type (press enter for Integrated):
- Enter agent pool (press enter for default):
- Enter agent name (press enter for MY_SERVER):
- Enter work folder (press enter for _work):
- Enter run agent as a service? (Y/N) (press enter for N):
- Enter enable SERVICE_SID_TYPE_UNRESTRICTED for agent service (Y/N) (press enter for N):
- Enable User Account to use for the service (press enter for NT AUTHORITYNETWORK SERVICE):
- Enter whether to prevent service starting immediately after configuration is finished (Y/N) (press enter for N):
to which I answered:
- (My server URL)
- Default (Integrated)
- Default (default)
- Default (MY_SERVER)
- Default (_work)
- Y
- Y
- Administrator
- Default (N)
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
Other things I have tried
1. Different configuration options
I tried with the following configuration options as well (after removing and re-installing).
- For question 8, I chose the default instead of specifying a user.
- For question 7, I chose the default instead of specifying Y.
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