Let’s go forward and begin by creating our agent. The very first thing that now we have to do is create a private entry token. A private entry token is used as an alternate password to authenticate to Azure DevOps. Private Entry Tokens are simple to create and revoke them if they’re not required.

We begin by clicking on the Consumer Settings Icon on the highest proper nook of our DevOps surroundings, and choosing Private Entry Tokens from the menu.

When you don’t have any tokens, click on on the New Token hyperlink button

Azure DevOps - Create New Token

This can pop up the Create a brand new private entry token panel. Present a reputation for the token, choose the group and expiration date. You possibly can create a customized outlined scope and set the suitable permissions that the token could have, or give it Full entry to your DevOps surroundings. For the aim of this text, we are going to present it with Full entry, however you too can choose Agent Swimming pools (learn, handle) and deployment group (learn, handle). You possibly can click on on the Present all scopes on the backside of the panel to see all out there authorization scopes for the private entry token. The picture under reveals the essential configuration.

Azure DevOps - Create New Access Token

As soon as the private entry token is created (and earlier than you shut your window), copy the token. You will want it in a while. Microsoft doesn’t retailer the token, so that you won’t be able to see it once more.

Azure DevOps - New Token Success Confirmation

Subsequent, we are going to go forward and configure the Safety for the Agent Pool. Azure DevOps group homeowners and server directors have permissions by default.

Navigate to the Agent Swimming pools by clicking on the Azure DevOps emblem on the highest left, choose Group Settings on the underside left, after which within the left hand navigation, click on on Agent Swimming pools. This can show the checklist of Agent Swimming pools within the heart pane. Choose the pool that you simply need to configure, and click on on the Safety tab within the newly opened pane. If the consumer account that will probably be used just isn’t proven, then just remember to or an administrator can add that consumer account. You can’t add your individual consumer account, however you need to have the ability to add a bunch that you’re a member of.

Azure DevOps - Agent Security

Now click on on the Brokers tab, and let’s create our agent. If there are not any out there brokers, you will notice a button on the display (New agent) to create your first agent.

This can pop up a dialog the place you possibly can choose your working system and obtain the agent.

Azure DevOps - Download Agent

Now, that you’ve got downloaded the agent, we are able to go forward and set up it and configure it. Extract the agent to a listing of your alternative, and run the config.cmd command. In our case we extracted the agent recordsdata into the C:DevOpsAgent listing.

Azure DevOps - Extracted Agent Source Files

When you run the config.cmd batch file, you’ll be requested for the Azure DevOps providers url, which is https://dev.azure.com/{organization_name}, after which enter or paste the private entry token that you simply created beforehand.

Azure DevOps - Agent Configuration PowerShell Script

To find out whether or not you need to use the agent in Interactive Mode or Service Mode, you possibly can click on on the hyperlink under and verify the variations on the Microsoft Docs web site:


Earlier than we activate the Agent, let’s go forward and create our first pipeline. We are going to make this pipeline easy that may embrace publishing the customizations in our dev surroundings, exporting the answer as managed and unmanaged and deploying this to our check surroundings as a managed answer.

Let’s go forward and create a couple of pipelines to check this course of.

Let’s go forward and create our first pipeline. Step one is to connect with the Repo. We are going to use the basic editor to create a pipeline with out YAML.

Azure DevOps - Connect to Source Code Repository

Within the choose supply web page, we are going to choose our Azure Repos Git, and choose the Staff Venture, the Repository and the Default department that will probably be used for our guide or scheduled builds.

Azure DevOps - Select Repo Source

Within the choose template web page, we are going to begin with an Empty job.

Azure DevOps - Select Configuration Template

Subsequent we are going to begin configuring the pipeline and including the duties for use with the agent. The picture under reveals the check pipeline that we created. The pipeline solely makes use of two duties, which is the Energy Platform Software Installer and the Energy Platform Publish Customizations.

Azure DevOps - Test with MS Agent

In fact this isn’t a really real looking pipeline, as we often want one thing that does extra than simply publish customizations, however the objective is simply to check that that is working with a Self-Hosted Agent. Simply to ensure the pipeline works, we are going to first strive it with the MS Agent.

I’ll go forward and click on the Save and Queue button and run this pipeline. After about 60 seconds, we get the outcomes that the pipeline executed efficiently.

Azure DevOps - Successful Test with MS Agent

Subsequent, I’ll go forward and edit the pipeline, and alter the agent pool to the self-hosted agent pool that I created, click on on the Save and Queue after which run the method.

Azure DevOps - Test with Self Hosted Agent

This could have been straight ahead, nevertheless it looks like there have been some points with operating this we encountered a couple of points with the Software Installer.

Azure DevOps - Failed Test with Self Hosted Agent

To get previous this, (and after contacting Microsoft Help) we needed to make some modifications to the pipeline, which included the set up of Nuget bundle and a Powershell script to Unregister the Bundle Supply earlier than operating this.

Azure DevOps - Test with Self Hosted Agent including Fix

This subject that’s addressed is said to the agent itself and never the PowerApps process. The next two hyperlinks speak about this in additional element:



After making these adjustments, we have been capable of execute the bundle appropriately.

Azure Devops - Successful Test with Fixed Self Hosted Agent

Though this solves our downside, and permits us to go forward and create a pipeline utilizing Energy Instruments, the underlying downside nonetheless exists.

I acquired an replace from Microsoft (Energy Apps assist) final week, that they have been capable of reproduce the difficulty utilizing a neighborhood construct agent, and primarily based on the diagnostics log, what appeared to occur is that the machine the place the agent was put in (a Home windows 10 machine) had a PackageManagement and PowerShellGet within the older variations, however the hosted AzureDevOps has extra trendy variations, 1.47 and a couple of.2x respectively.

As soon as Microsoft eliminated the newer variations they have been capable of reproduce this subject. As a brief workaround, we have been informed that we may replace these two modules for the construct agent consumer after which retry. The next are the steps which are wanted to observe:

  1. Set up-PackageProvider -Identify “NuGet” -Power -ForceBootstrap -Scope CurrentUser -MinimumVersion
  2. Set up-Module -Identify PackageManagement -MinimumVersion 1.4.7 -Scope CurrentUser -Power -AllowClobber
  3. Set up-Module -Identify PowerShellGet -MinimumVersion 2.2.5 -Scope CurrentUser -Power -AllowClobber

Since this subject was reported, the timeline for a repair is meant to be coming early this week (Ween of 11/23/2020), when a brand new model will probably be printed to the Visible Studio market which can verify and replace the bundle suppliers.

Hopefully everybody which will probably be working with self-hosted brokers can profit from this replace. I’ll replace this put up was the change has been applied.


Please enter your comment!
Please enter your name here