Azure App Service Settings task
Azure DevOps Services
Use this task to configure App settings, connection strings and other general settings in bulk using JSON syntax on your web app or any of its deployment slots. The task works on cross platform Azure Pipelines agents running Windows, Linux or Mac. The task works for ASP.NET, ASP.NET Core, PHP, Java, Python, Go and Node.js based web applications.
Arguments
| Parameters | Description |
|---|---|
ConnectedServiceNameAzure subscription |
(Required) Name of the Azure Resource Manager service connection Argument aliases: ConnectedServiceName |
appNameApp name |
(Required) Name of an existing App Service |
resourceGroupNameResource group |
(Optional) Name of the resource group |
slotNameSlot |
(Optional) Name of the slot Default value: production |
appSettingsApp settings |
(Optional) Application settings to be entered using JSON syntax. Values containing spaces should be enclosed in double quotes. |
generalSettingsGeneral settings |
(Optional) General settings to be entered using JSON syntax. Values containing spaces should be enclosed in double quotes. See the App Service SiteConfig object documentation for the available properties. |
connectionStringsConnection settings |
(Optional) Connection strings to be entered using JSON syntax. Values containing spaces should be enclosed in double quotes. |
Following is an example YAML snippet to deploy web application to the Azure Web App service running on windows.
Example
variables:
azureSubscription: Contoso
WebApp_Name: sampleWebApp
# To ignore SSL error uncomment the below variable
# VSTS_ARM_REST_IGNORE_SSL_ERRORS: true
steps:
- task: AzureWebApp@1
displayName: Azure Web App Deploy
inputs:
azureSubscription: $(azureSubscription)
appName: $(WebApp_Name)
package: $(System.DefaultWorkingDirectory)/**/*.zip
- task: AzureAppServiceSettings@1
displayName: Azure App Service Settings
inputs:
azureSubscription: $(azureSubscription)
appName: $(WebApp_Name)
# To deploy the settings on a slot, provide slot name as below. By default, the settings would be applied to the actual Web App (Production slot)
# slotName: staging
appSettings: |
[
{
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
"value": "$(Key)",
"slotSetting": false
},
{
"name": "MYSQL_DATABASE_NAME",
"value": "$(DB_Name)",
"slotSetting": false
}
]
generalSettings: |
[
{
"alwaysOn": true,
"webSocketsEnabled": false
}
]
connectionStrings: |
[
{
"name": "MysqlCredentials",
"value": "$(MySQl_ConnectionString)",
"type": "MySql",
"slotSetting": false
}
]
Open Source
This task is open source on GitHub. Feedback and contributions are welcome.
Feedback
Issottometti u ara feedback għal