Hello Chris, In order to install an Azure DevOps Self-Hosted Agent on a windows virtual machine and configure it to run as a service.
Go to Azure DevOps > Select your Organization.
Navigate to Project Settings > Agent Pools.
Click Add Pool > Give it a name (in this case I am using TEST-POOL
).
Select Self-hosted and create.
Download and extract the Agent under C:\agent
Configure the Agent under cd C:\agent and then run .\config.cmd
Enter server URL: https://dev.azure.com/Whatever is your ORG NAME
Enter authentication type: Just press Enter first time
(default is PAT).
Enter agent pool: Use the pool you created (For example TEST-POOL
).
Enter agent name: Any name of your choice (e.g., LAPTOP-AGENT
).
Enter work folder: Press Enter
to use work
.
Enter run agent as a service?: Type y
and press Enter
.
Enter user account to use for the service: Use NT AUTHORITY\NETWORK SERVICE
or a custom user.
The agent should register successfully.
Now coming to your blocker when trying the above steps i.e when you are trying to install the agent on your system and following the prompts upto where it asks to enter user account to use for the service, you are getting Access is denied error correct?
If so, could you kindly check few things for me and let me know-
We can start by checking if the user i.e. you have sufficient permission. For this you can goto run and type secpol.msc which should open Local Security Policy tab.
As highlighted in screenshot, Goto Security Settings > Local Policies > User Rights Assignment > Log on as a service.
Open it and add your specified (SRVR1\user
).
Before that once check Deny log on as a service as well. If your user is listed, remove it.
Once the above checks are done, goto the path where your agent is, goto it's property section > security tab and add your user if missing or edit and cross the permission. preferably give full control.
and restart your system.
If your issue persists, check event logs under event viewer and look for error messages related to AgentService.exe
and you confirmed those details in comment section. I have replied below your comment on the meaning of those errors and how can you clear them up.