Skip to main content

Configure Tasks

Configure the following tasks for API release.

Create WebApp​

  1. Select Create WebApp and choose a subscription. Select the script path for the WebApp as shown in the image and select Ok.
  2. Add the script argument in the Script Argument Section. -resourceGroupName "$(_ResourceGroupName)" -Location "$(_Location)" -ASPName "$(AppServicePlanName)" -ASPSize "$(AppServicePlanSize)" -AppEnvironment "$(DeployEnvironment)" -WebAppName "$(AppName)" -SQLServerName "$(SQLServerName)"
  3. Select the Latest installed version under Azure PowerShell Version.
  4. Select "Use PowerShell Core" under Advanced.
  5. Select Enabled under Control Options and add the custom condition. and(succeeded(), eq(variables['_CreateWebapp'], 'true'))

Create WebApp

Custom Condition

Create Backup WebApp Build​

  1. Select Create Backup WebApp Build and the script path.
  2. Add the following script argument. -WebAppName "$(AppName)" -StorageAccountName "$(StorageAccountName)" -StorageAccountkey "$(StorageAccountkey)" -StorageContainerName "$(StorageContainerName)"
  3. Select the Latest installed version under Azure PowerShell Version.
  4. Select "Use PowerShell Core" under Advanced.
  5. Select Enabled under Control Options and add the custom condition. and(succeeded(), eq(variables['BackupBuild'], 'true'))

Add Script Path

Create Restore WebApp Build​

  1. Select Create Restore WebApp Build.
  2. Add the script path and select Ok.
  3. Add the following script argument. -RestoreFileUrl "$(RestoreFileUrl)" -StorageAccountkey "$(StorageAccountkey)" -FileExtension ".zip"
  4. Select the Latest installed version under Azure PowerShell Version.
  5. Select "Use PowerShell Core" under Advanced.
  6. Select Enabled under Control Options and add the custom condition. and(succeeded(), eq(variables['RestoreBuild'], 'true'))

Restore WebApp Script

JSON File Transform​

  1. Select JSON File Transform.
  2. In the Target files text area, Select File format (JSON) and add **/appsettings.json.
  3. Select Enabled under Control Options and add the custom condition. and(succeeded(), eq(variables['RestoreBuild'], 'false'))

Deploy Azure App Service Linux​

  1. Select Deploy Azure App Service Linux.
  2. Choose a subscription, App type, App name, Resource group, Slot, script path for the deploy service as shown in the image.
  3. Select "Deploy to Slot or App Service Environment".
  4. Select Enabled under Control Options and add the custom condition. and(succeeded(), eq(variables['DeployEnvironment'], 'Linux'))

Deploy Azure

Azure App Service Settings​

  1. Select Azure App Service Settings.
  2. Choose a subscription, App Service name, Resource group, Slot for the Azure app service.
  3. Under Application and Configuration Settings > connection strings, add the following code.
[
{
"name": "DefaultConnection",
"value": "$(ConnectionStrings.DefaultConnection)",
"type": "$(type)",
"slotSetting": false
}
]

Azure App Service Settings

Restart Azure App Service​

  1. Select restart Azure App Service.
  2. Choose a subscription, Action (Restart App Service) and App Service name for the Azure app service as shown in the image and select Save.

Restart Azure App Service