Setup 'Default' Self Hosted Agent at your Windows OS

 

Why Self Hosted Agent is required?
At URL, MS says Parallel Jobs are disabled by default

 

Steps to Create Self Hosted Agent 

For Parallel Pipelines, we must have at least one agent in our DevOps Organization

  • Go to DevOps
  • Go to your Organization Settings
  • Click Agent Pools
    • MS Hosted- a VM run by MS to run your agent
      • Azure Pipelines
    • Self Hosted- Host your own agent on your persona PC
      • Default

 

Create our Self Hosted Agent

  • Go to DevOps > Click Agent Pools
  • Click Default > Client Agents > Click New Agent
  • Give Options of OS (Windows/Mac/Linux) on which you want host your agent. Lets go with Windows
  • Click Download - to download Agent, which you have to configure at your Windows PS
    • At your PC open Powershell with Administrator Permission
    • Choose Drive, say we choose G Drive, Move to G Drive Root
    • Run the fist command given in interface
      • Create an agent directory in G   Drive
    • Run the second command given in interface
      • Extract the files from downloaded Zip to agent folder
    • Run 3rd command
      • Run the config commands
      • Asking the server URL
        • URL of devOps including organization name (without slash at end)
      • Now ask for Authentication type
        • We need personal authentication toke, so press enter only
        • Ask for Personal Access Token now
        • Go go DevOps > User settings (on top right) > Personal Access Token- 
          • Copy Token form DevOps and paste next to Personal Access token In Powershell and press Enter 
          • Create new one not present
      • Ask for Agent in which you want to install this local agent. Since Default is ok, so just press enter
      • Ask for local Agent name, in which you want to show (local PC Name) -   Press Enter
      • After successfully connected it as for Working folder name at local
        • Create a folder say DeepakDevOpsAgent inside G folder 
        • Specify same and enter
      • Then ask - Run agent as service - N so just press enter
      • Then ask - autologin and run agent at login- N so just press enter

 

 

Check your Self Hosted Agent in DevOps

  • G0 to DevOps > go to organization settings
  • Click Agent Pools
    • Select Default
    • Select Agent Tab
      • We can see our local agent here but on Offline mode

 

 

Run Self Hosted agent at DevOps

  • At local inside agent folder we can see run batch file
    • Just run that batch file in Powers Shell
  • Go to your Agents at DevOps
    • you can see your self hosted agent in online mode

 

 

 

 


Related Question