Skip to main content

Command Palette

Search for a command to run...

Run Azure self hosted agent as service

Updated
1 min read
Run Azure self hosted agent as service
  1. Open a Command Prompt as an administrator.

  2. Run the following sc create command to create the service:

sc create my-agent binPath= "C:\Windows\System32\cmd.exe /c C:\agent\run.cmd"
  1. If you want to configure the service to start automatically with Windows, you can run the following sc config command:
sc config my-agent start= auto
  1. Start the service using the sc start command:
sc start my-agent

Ensure that you're running these commands directly within the Command Prompt and not within a PowerShell session to avoid any issues with command interpretation.

If you continue to encounter any issues, please provide more details, and I'll be happy to assist further.

More from this blog

DevOps Journey with M Hassan

174 posts

I am writing these blogs because I recently completed a comprehensive DevOps course where I gained in-depth knowledge of the topics mentioned. As I progressed through the course, I realized the importance of having a concise and accessible resource to revise and reinforce my understanding of each topic. Therefore, I decided to create cheat sheets in the form of blog posts. These cheat sheets will not only serve as a handy reference for myself but also benefit others who are also interested in mastering DevOps concepts. By documenting each topic and providing concise explanations, I aim to create a valuable resource that simplifies complex concepts and facilitates hands-on practice. This way, I can solidify my own understanding while helping others on their DevOps journey.