Use Deployment Groups in Azure DevOps to Deploy a .NET App

1.25 hours
  • 4 Learning Objectives

About this Hands-on Lab

You have a .NET application you need to deploy to a specific Azure virtual machine. You must use Azure DevOps to create a CI/CD pipeline and deploy this application using deployment groups to target that Azure VM.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create an Azure DevOps Organization
  • Log in to the Azure Portal using the provided credentials
  • Search for Azure DevOps from the Services menu
  • Create a new organization and project named MyFirstProject
Create a Build Pipeline
  • Create a new GitHub repository
  • Import the code from the provided GitHub repository
  • Create a pipeline in Azure Pipelines, using the code from the deploy branch
Build the Environment
  • Create a release pipeline to deploy the ARM templates, creating the environment
  • Make sure to create a service connection using the service principal provided
Build the Release Pipeline
  • Once the environment has been built, log in to the Azure VM and install the agent
  • Add to the existing release pipeline to deploy the web application to IIS

Additional Resources


Log into the Azure portal and search for Azure DevOps from the Services menu. Create a new Azure DevOps organization and project named MyFirstProject. Select Azure Repos and import this provided code.

The application is located on the deploy branch. Import the code on deploy into your newly created Azure Repos repository. Once you've imported the code, create a build pipeline that will package up the code and ARM templates included in the repo.

Once you have your packaged application, create a release pipeline that will deploy the ARM templates, which creates a VM, a SQL server, and SQL database.

Once you've created the environment, create the deployment group.

Before deploying the web application, you will need to configure the SQL connection string using the details provided in the lab's additional resources.

Next, you can go ahead and deploy the web application to the deployment group.

Additional Resources

GitHub repository Clone URL:

ARM Template Override parameters:

Note: Change the -databaseServerName parameter to a unique name (e.g. db1-server04042303).

-vmName "vm1" -adminUsername "cloud_user" -adminPassword "LA_ACG_Together2020!!" -appInsightsLocation "Central US" -vmSize "Standard_D2s_v3" -location "Central US" -windowsOSVersion "2016-Datacenter-smalldisk"  -databaseServerName "db1-server" -databaseUsername "dbadmin" -databasePassword "LA_ACG_Together2020!!" -databaseLocation "Central US" -databaseName "db1-db"

Additional SqlPackage.exe Arguments: /p:AllowIncompatiblePlatform=True

SQL Connection String details:

Note: Change the Data Source parameter to a unique name (e.g.

  • Name: defaultConnection
  • Value: Data;Initial Catalog=db1-db;User ID=dbadmin;Password=LA_ACG_Together2020!!

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?