Deployment Groups in Azure Pipelines | Azure DevOps

Sachin Modi
3 min readJan 12, 2021

Deployment Groups : It is a logical set of deployment target VMs that have agents installed on those VMs.

In this example we will look how can we deploy an ASP.Net Core application on VM using Azure pipeline.

Below Steps need to be follow.

Step 1: Create a VM — Install IIS and the hosting bundle

You can go to azure portal and can create a Windows VM on azure, Please allow inbound traffic for port 80. Once VM is created login into that machine and install IIS and the hosting bundle.

Step 2: Register the server in the deployment group

For this go to Azure Devops → Pipelines → Deployment groups →

Add a deployment group and provide deployment group name and click on create. Once this is done you will get registration script, just copy that script and run in PowerShell onto VM which was created in earlier steps.

Once the above steps are done, this agent will ask for Personal Authentication Token to authenticate the Azure DevOps Project.

You can create the PAT(Personal Authentication Token) in Azure Devops. Please refer the below image to create the PAT.

Go to user setting in Azure Devops and click on Personal access tokens and do the below steps.

Post the above steps, you will notice the target VM in deployment groups.

Step 3: Use Azure pipeline to deploy the ASP.Net Core application

Now lets create a new release pipeline to deployment the ASP.Net Core application on the above target machine.

Here I have selected the already build artifacts and enabled the continuous deployment.

We can remove the agent job and add deployment group job in the release pipeline.

Now we can deploy this artifacts on IIS for this we can add below two task.

Now I am going to change the code in existing repository which will automatically trigger the build and release pipeline and deploy the application on the target VM.

Please refer the below image it has triggered a release pipeline and successfully deployed on target machine.

--

--