Add Non-Containerized Artifacts for Azure Web App Deployment

Updated 1 month ago by Michael Cretzman

Currently, this feature is behind the Feature Flags AZURE_WEBAPP and AZURE_WEBAPP_NON_CONTAINER. Contact Harness Support to enable the feature.

Setting up a Harness Azure Web App deployment is a simple process. You add your artifact's repo and settings to a Harness Service, and then add any of the Web App's application settings and connection strings.

These repo and settings are used when Harness deploys your Web App.

This topic covers adding a non-containerized artifact. For steps on adding a Docker image for Web App Deployment, see Add Your Docker Image for Azure Web App Deployment.

In this topic:

Before You Begin

Supported Platforms and Technologies

See Supported Platforms and Technologies.

Limitations

The Harness Azure Web Application Service type supports the following repos:

Step 1: Create the Harness Service

The Harness Service represents your Azure Web App.

You identify the artifact for the app, configuration settings, and any secrets and configuration variables.

In your Harness Application, click Services.

Click Add Service. The Service settings appear.

Enter a name for your Service. Typically, the same name as the Web App.

In Deployment Type, select Azure Web Application.

In Artifact Type, select a non-containerized type.

Click Submit. The Service is created.

Step 2: Add the Artifact

You will add the same artifact you use in your Web App.

Ensure you have set up a Harness Artifact Server or Cloud Provider (for Azure Container Registry or AWS S3) that connects to the image's repo. See Connect to Azure and Artifact Repo for Your Web App Deployments.

In the Harness Service, click Add Artifact Source.

Select the Artifact Server type.

Fill out the Artifact Source settings.

For Jenkins, you will select the job and artifact. Harness will run the job and obtain the artifact metadata needed to pull the artifact at deployment runtime.

For details on configuring the supported Artifact Source types, see Service Types and Artifact Sources.

Here's an example of an Artifactory Artifact Source used to pull a WAR file:

When you are done, click Submit.

Next, click Artifact History to see the artifacts and builds Harness pulls from the repo.

Option: Startup Script

You can use Script to add a startup script for your app.

See What are the expected values for the Startup File section when I configure the runtime stack? from Azure.

Option: App Service Configuration

In Azure App Service, app settings are variables passed as environment variables to the application code.

See Configure an App Service app in the Azure portal from Azure.

You can set these using the Azure CLI:

az webapp config appsettings set --resource-group <group-name> --name <app-name> --settings DB_HOST="myownserver.mysql.database.azure.com"

Or via the portal:

You can also set Application settings and Connection strings in the Harness Service.

Here's an example of setting Application settings in the Harness Service:

This is the same as setting them in the Azure portal, in Configuration, Application Settings, Advanced edit.

Important Note

  • If you add App Service Configuration settings in the Harness Service, you must include a name ("name":), and the name must be unique. This is the same requirement in Azure App Services.

Using Secrets and Variables Settings

You can use Harness secrets and Service or Workflow variables in the Application settings and Connection strings in the Harness Service.

These settings use JSON, so ensure that you use quotes around the variable or secret reference:

  {
"name": "PASSWORD",
"value": "${$secret.getValue('secret_key')}",
"slotSetting": false
},

Next Step

Configure As Code

To see how to configure the settings in this topic using YAML, configure the settings in the UI first, and then click the YAML editor button (</>).


How did we do?