How To Deploy Your .NET Core App with Azure Pipeline on Windows IIS

tong eric
Bina Nusantara IT Division
5 min readDec 26, 2020

Simple configuration of Azure Pipeline for deployment .NET Core App

Prerequires:

1. DevOps Account

2. .NET Core project that has been configured for run on IIS and store in Azure repos

3. IIS Server that has been configured

Azure Pipelines is a cloud service that you can use to automatically build and test your code project and make it available to other users. It works with just about any language or project type. Azure Pipelines combines continuous integration (CI) and continuous delivery (CD) to test and build your code and ship it to any target constantly and consistently. In today tutorial we will learn how to configure an Azure pipeline to deploy on targeting Windows IIS.

Configure Deployment Group

Before we start to build our Azure Pipeline, we must let our account know where the targeted machine for deployment is. A deployment group is a logical set of deployment target machines that have agents installed on each one. To let our account know where to target, we simply installed an agent on our machine and it will be recognized by deployment group

First, login to DevOps account and open deployment group menu on Organization Name -> Project Name -> Pipeline -> Deployment Group

Click at + New button to create an new Deployment Group

Creating deployment group only need a name for it and some brief description (optional). After you create your deployment group, it will show you shell script like below

Copy those script and run it on Windows PowerShell with administrator access.

After you got a result like example above, you can set up an tag to make it easier to mark off this server. Follow the instruction that script make to you.

When it’s all done, you can check for the machine that already being registered on your deployment group. Now the pre- step for making Azure pipeline is done, lets go to the next step on “Building CI Pipeline”

Building an CI pipeline

At first, go the menu “Pipeline” on Organization Name -> Project Name -> Pipeline -> Pipeline (mark by green box) and click for New pipeline that appear in right upper corner on the windows (mark by red box).

Choose “Use classic editor” to create a pipeline without configuration YAML file.

Select source of project with Azure Repos Git, then configure to a project branch that you want to deploy

After that choose an template of ASP .NET Core application, you can find it by typing “net core” on search bar in upper right.

After that you will see an CI task that already been configure, you can modify those steps as you want like remove some task or making variant save name of artifact and of course for naming this pipeline. Feel free to explore what can those tasks do and what you can modifying. In my case io will use default setting for this template.

Choose Triggers menu after you finished to configure your task

In Triggers menu, mark the checkbox of Enable Continuous Integration and select which branch did you want to be connected for this pipeline

After that press for Save & Queue button and wait for the first time running result of this CI pipeline

Building an CD pipeline

Now after we configure an CI pipeline, we are ready to build a deplpyment pipeline for our project

First find a Releases menu on Organization Name -> Project Name -> Pipeline -> Releases, pick + new button and choose for new release pipeline.

Choose a template for IIS Website and SQL Database Deployment

Give a proper name for your CD pipeline and then click the add artifact option.

Select CI pipeline that you made before for this artifact and then click thunder button on the upper right. Enabled Continuous deployment trigger on it.

Go to the Stage 1 to configure your deployment task, first remove SQL database deployment task that you didn’t need in this pipeline.

As you can see there is 2 main task that we have to configure. First in Stage 1 set up website name and application pool for your website. You can check in IIS Server Manager for application pool and name if your website is already being configure. In my case I will use for “Defaule Website” as my deployment website.

Then select a Deployment Group that you made before.

After that you can save your pipeline and congrats, your Azure pipeline has been set up and ready to launch. In those tasks there is also some option to modify about so feels free to find out what can it do for more personalized deployment.

That’s all about how to configure an Azure Pipeline Deploy Your .NET Core App with Azure Pipeline on Windows IIS.

--

--