Azure Web App for Container task

Azure Pipelines

Use this task to deploy Web Apps, Azure Functions, and WebJobs to Azure App Services using a custom Docker image.

Task Inputs

ParametersDescription
azureSubscription
Azure subscription
(Required) Name of Azure Resource Manager service connection.
appName
App name
(Required) Name of Web App for Container.
deployToSlotOrASE
Deploy to Slot or App Service Environment
(Optional) Set to true to deploy to an existing deployment slot or Azure App Service Environment. For both the targets, the task needs a Resource Group name. For the deployment slot option, the default is to deploy to the production slot, or you can specify any other existing slot name. If the deployment target is an Azure App Service environment, leave the slot name as production and just specify the Resource Group name.
Default value: false
resourceGroupName
Resource group
(Required if deployToSlotOrASE is true) Name of the Resource Group containing the Web App for Containers.
slotName
Slot
(Required) Enter or select an existing slot other than the production slot.
Default value: production
imageName
Image name
(Required) Image to be used for deployment.
Example: myregistry.azurecr.io/nginx:latest
containerCommand
Startup command
(Optional) Startup command to be executed after deployment.
appSettings
App settings
(Optional) Application settings to be entered using the syntax '-key value'. Values containing spaces must be enclosed in double quotes.
Example: -Port 5000 -RequestTimeout 5000 -WEBSITE_TIME_ZONE "Eastern Standard Time"
configurationStrings
Configuration settings
(Optional) Configuration strings to be entered using the syntax '-key value'. Values containing spaces must be enclosed in double quotes.
Example: -phpVersion 5.6 -linuxFxVersion: node|6.11

Example

This example deploys a Web App on Linux using containers:


variables:
  imageName: contoso.azurecr.io/aspnetcore:$(build.buildId)
  azureSubscription: Contoso
  # To ignore SSL error uncomment the following variable
  # VSTS_ARM_REST_IGNORE_SSL_ERRORS: true 

steps:
- task: AzureWebAppContainer@1
  displayName: Azure Web App on Container Deploy
  inputs:
    appName: webappforcontainers
    azureSubscription: $(azureSubscription)
    imageName: $(imageName)

Open Source

This task is open source on GitHub. Feedback and contributions are welcome.