By using this site, you acknowledge that you have read and understand our Cookie policy, Privacy policy and Terms .

Data analytics with Microsoft Azure cloud platform.

rss_feed Subscribe RSS

It might be useful to push artifact or build variables to your Azure websites environment variables in Release pipelines. 

In this article, I'm going to show you how to add build number in Build pipeline to your Azure website when publishing using Release pipeline in Azure DevOps. For this website, the build number is also shown in page footer for reference. 

Available variables

Refer to the following link to find out the complete list of available environment variables that you can use in Release pipelines.

For build number, we will use this particular variable:


The build number or the commit identifier.

Azure pipelines example: 20170112.1

Jenkins/TeamCity example: 20170112.1

TFVC example: Changeset 3

Git example: 38629c964

GitHub example: 38629c964

Use variable

In Azure App Service Deploy task in my release job, update App settings in Application and Configuration Settings section to add the following value:


This step will add an environment variable named KONTEXT_BUILD_NUMBER to my ASP.NET Core application settings when doing the deployment.

Please note 'Starlink-ASP.NET Core-CI' is the artifact alias for my website build artifact. You need to replace it accordingly to your own artifact alias. 

Run the release pipeline

And then you can run the release pipeline. In the output logs, you can see the application settings is added. 

2019-12-01T11:16:31.9073238Z ##[section]Starting: Azure App Service Deploy: kontext
2019-12-01T11:16:31.9280133Z ==============================================================================
2019-12-01T11:16:31.9280240Z Task         : Azure App Service deploy
2019-12-01T11:16:31.9280327Z Description  : Deploy to Azure App Service a web, mobile, or API app using Docker, Java, .NET, .NET Core, Node.js, PHP, Python, or Ruby
2019-12-01T11:16:31.9280408Z Version      : 4.157.4
2019-12-01T11:16:31.9280454Z Author       : Microsoft Corporation
2019-12-01T11:16:31.9280535Z Help         :
2019-12-01T11:16:31.9280606Z ==============================================================================
2019-12-01T11:16:32.6839383Z Got service connection details for Azure App Service:'kontext'
2019-12-01T11:16:33.9921958Z Updating App Service Application settings. Data: {"WEBSITE_RUN_FROM_PACKAGE":"1"}
2019-12-01T11:16:34.5066167Z Updated App Service Application settings and Kudu Application settings.
2019-12-01T11:16:42.2346930Z Package deployment using ZIP Deploy initiated.
2019-12-01T11:16:47.2178269Z Successfully deployed web package to App Service.
2019-12-01T11:16:47.2181086Z Updating App Service Application settings. Data: {"KONTEXT_BUILD_NUMBER":"20191201.2"}
2019-12-01T11:16:59.4388373Z Updated App Service Application settings and Kudu Application settings.
2019-12-01T11:17:00.0648701Z App Service Application URL:
2019-12-01T11:17:00.0730976Z ##[section]Finishing: Azure App Service Deploy: kontext

Check the application settings in Azure App Service

In Azure portal, you can also find the new settings in Settings > Configurations > Application Settings


Build number is just one of the artifact variables that you can use in release pipelines and you can use any other available variables in your Release pipelines. You can also configure this in pipeline yml file instead of using the Classic UI.

If you want to use the environment variables in PowerShell, the naming will be slightly different. For example, the build number environment name for my artifact is:


To save your time, you can find all the available environment variable names in Initialize Job step in your release pipeline as the following screenshot shows:

info Last modified by Raymond at 3 months ago * This page is subject to Site terms.

info About author

More from Kontext

local_offer kontext local_offer Azure

visibility 8
thumb_up 0
access_time 2 months ago

From release v0.6.0, Kontext website now runs from a package (zip file) in Azure App Services. This ensures storage (incl. database storage, blob storage for uploaded files) is separated from the application and the application itself is read-only.  Azure DevOps support I...

open_in_new View

local_offer Azure local_offer ssl

visibility 21
thumb_up 0
access_time 3 months ago

Google Chrome browser will mark websites as insecure if HTTPS is not enabled. Certificate issuer To enable SSL on your Azure websites, you can purchase SSL certificates from many certificate authorities. Let’s Encrypt is a free, automated, and open Certificate Authority. ...

open_in_new View

local_offer kontext local_offer Azure

visibility 130
thumb_up 4
access_time 4 months ago

From release v0.6.1, Kontext platform is server-less and cloud native with horizontal scalabilities.

open_in_new View

Kontext Pre-release v0.6.0

local_offer kontext local_offer Azure

visibility 134
thumb_up 1
access_time 4 months ago

Kontext website is now upgraded to ASP.NET Core 3.0 with many new features.

open_in_new View

Kontext Column

Kontext Column

Created for everyone to publish data, programming and cloud related articles. Follow three steps to create your columns.

Learn more arrow_forward
info Follow us on Twitter to get the latest article updates. Follow us