You are on page 1of 6

Azure Devops Tips

Deployment
October 2020
Deployment
This document describes an easy way for deploying an ASP.NET Core Web application to an Azure App
Service using a Build or Release pipeline. This should provide you with enough information for your own
project.

Prerequisites: a working App Service


When you go to portal.azure.com, you create an app service:

When you select the app service, you can create a “Publish profile”.

This publish profile is a file that you can use in Visual Studio to directly publish your app to Azure. This
step is not necessary, but let’s you check if your app service is capable of hosting your application
correctly.

Page 2
Create a Service Connection
Go to dev.azure.com, navigate into your organization and select project settings:

Now select “service connections”:

Page 3
Now create a new Service Connection based on “Azure Resource Manager” and use publish profile
based authentication.

It is import that you create this exact type of service connection, otherwise your deployments may not
work! Give your service connection an appropriate name, eg. “Azure-Deploy-Connection”. You will need
this name later on.

Deployment during build (yaml deployment)


Some prefer to deploy as a last step in the build proces (e.g. when tests are run and all went well). This
snippet will accomplish the deployment:

Page 4
Note: you use your appName (as given when creating the app service on Azure) and your service
connection name. This kind of deployment is ideal for pushing out alpa/beta testing environments.

Deployment during Release


Azure Devops also knows the concept of a release pipeline, where you trigger a release after building an
artifact:

Stage 1 contains the following task:

Page 5
Remarks:

- You need to use your app name and service connection name
- Choose “Azure Web App Deploy” and NOT “Azure App Service Deploy”

Page 6

You might also like