Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure DevOps Agent won't start and shows: Error 1 Incorrect Function - Service could not start

I configured the build agent as a service but when I go to start the agent I get the error:

Error 1 Incorrect Function - Service could not start

Azure DevOps Agent configured as a service but service does not start

like image 348
itye1970 Avatar asked Feb 28 '19 12:02

itye1970


People also ask

How do I restart Azure DevOps agent?

Right-click the entry and then choose restart. If you're running the agent interactively, then go to the PowerShell console in which it's running and press Ctrl+C to stop it and then run run. cmd to start it again.

What is the function of service connection in Azure DevOps?

A service connection, in simple terms, is a defined connection that allows Azure DevOps to communicate with an external service.


1 Answers

Copied from the comments:

ok ill answer my own question, when the config.cmd command is run, it allocates the network service as the account to run the service. However it does NOT automatically give permissions to where the agent folders are installed. So it fails to run. Stupid as this should be flagged when running the config.cmd command! The error message is nonsense and misleading. So if the agent is in c:\users\abc\agent you need to give the network service permissions to access that folder!

like image 188
sirdank Avatar answered Nov 03 '22 01:11

sirdank