Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App Service Settings Changes #11211

Merged
merged 4 commits into from
Aug 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Tasks/ArchiveFilesV2/* @bryanmacfarlane

Tasks/AzureAppServiceManageV0/* @kmkumaran @SumiranAgg @vincentdass

Tasks/AzureAppServiceSettingsV1/* @eaarora-ms @SumiranAgg @vincentdass @niadak
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


Tasks/AzureCLIV1/* @sachinma

Tasks/AzureCloudPowerShellDeploymentV1/* @kmkumaran
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureAppServiceSettingsV1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ steps:
displayName: 'Azure App Service Settings: demo_webapp'
inputs:
azureSubscription: demo_subscription_id
WebAppName: demo_webapp
appName: demo_webapp
appSettings: |
[ { "name": "key1", "value": "valueabcd", "slotSetting": false }, { "name": "key2", "value": "valueefgh", "slotSetting": true } ]
generalSettings: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"loc.friendlyName": "Azure App Service Settings",
"loc.helpMarkDown": "[Learn more about this task](https://aka.ms/azurewebappdeployreadme)",
"loc.helpMarkDown": "[Learn more about this task](https://aka.ms/AA5wsgy)",
"loc.description": "Update/Add App settings an Azure Web App for Linux or Windows",
"loc.instanceNameFormat": "Azure App Service Settings: $(WebAppName)",
"loc.instanceNameFormat": "Azure App Service Settings: $(appName)",
"loc.group.displayName.ApplicationAndConfigurationSettings": "Application and Configuration Settings",
"loc.input.label.ConnectedServiceName": "Azure subscription",
"loc.input.help.ConnectedServiceName": "Select the Azure Resource Manager subscription",
"loc.input.label.WebAppName": "App Service name",
"loc.input.help.WebAppName": "Enter or Select the name of an existing Azure App Service",
"loc.input.label.ResourceGroupName": "Resource group",
"loc.input.help.ResourceGroupName": "Enter or Select the Azure Resource Group that contains the Azure App Service specified above",
"loc.input.label.appName": "App Service name",
"loc.input.help.appName": "Enter or Select the name of an existing Azure App Service",
"loc.input.label.resourceGroupName": "Resource group",
"loc.input.help.resourceGroupName": "Enter or Select the Azure Resource Group that contains the Azure App Service specified above",
"loc.input.label.slotName": "Slot",
"loc.input.help.slotName": "Enter or Select an existing Slot. If no slot is selected, changes will be made to production.",
"loc.input.label.appSettings": "App settings",
Expand Down Expand Up @@ -39,5 +39,6 @@
"loc.messages.FailedToUpdateAppServiceConfiguration": "Failed to update App service '%s' configuration. Error: %s",
"loc.messages.FailedToGetAppServiceConfiguration": "Failed to get App service '%s' configuration. Error: %s",
"loc.messages.FailedToGetAppServicePublishingCredentials": "Failed to fetch App Service '%s' publishing credentials. Error: %s",
"loc.messages.FailedToGetAppServiceApplicationSettings": "Failed to get App service '%s' application settings. Error: %s"
"loc.messages.FailedToGetAppServiceApplicationSettings": "Failed to get App service '%s' application settings. Error: %s",
"loc.messages.AppServiceSettingsNotEnabled": "App Service Settings is not enabled. Please provide one of the following : App Settings or General Settings or Connection Strings."
}
8 changes: 6 additions & 2 deletions Tasks/AzureAppServiceSettingsV1/azurewebappsettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,17 @@ async function main() {
tl.setResourcePath(path.join( __dirname, 'task.json'));
tl.setResourcePath(path.join( __dirname, 'node_modules/azurermdeploycommon/module.json'));
var connectedServiceName = tl.getInput('ConnectedServiceName', true);
var webAppName: string = tl.getInput('WebAppName', true);
var resourceGroupName: string = tl.getInput('ResourceGroupName', false);
var webAppName: string = tl.getInput('appName', true);
var resourceGroupName: string = tl.getInput('resourceGroupName', false);
var slotName: string = tl.getInput('slotName', false);
var AppSettings: string = tl.getInput('appSettings', false);
var ConfigurationSettings: string = tl.getInput('generalSettings', false);
var ConnectionStrings: string = tl.getInput('connectionStrings', false);

if(!AppSettings || !ConfigurationSettings || !ConnectionStrings) {
throw Error(tl.loc("AppServiceSettingsNotEnabled"));
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should target a batch call for the next iteration

var azureEndpoint: AzureEndpoint = await new AzureRMEndpoint(connectedServiceName).getEndpoint();
console.log(tl.loc('GotconnectiondetailsforazureRMWebApp0', webAppName));
if (!resourceGroupName) {
Expand Down
22 changes: 12 additions & 10 deletions Tasks/AzureAppServiceSettingsV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"friendlyName": "Azure App Service Settings",
"description": "Update/Add App settings an Azure Web App for Linux or Windows",
eaarora-ms marked this conversation as resolved.
Show resolved Hide resolved
"helpUrl": "https://docs.microsoft.com/azure/devops/pipelines/tasks",
"helpMarkDown": "[Learn more about this task](https://aka.ms/azurewebappdeployreadme)",
"helpMarkDown": "[Learn more about this task](https://aka.ms/AA5wsgy)",
"category": "Deploy",
"visibility": [
"Build",
Expand All @@ -20,6 +20,7 @@
"Minor": 0,
"Patch": 0
},
"preview": "true",
"minimumAgentVersion": "2.104.1",
"groups": [
{
Expand All @@ -41,7 +42,7 @@
"helpMarkDown": "Select the Azure Resource Manager subscription"
},
{
"name": "WebAppName",
"name": "appName",
"type": "pickList",
"label": "App Service name",
"defaultValue": "",
Expand All @@ -52,7 +53,7 @@
"helpMarkDown": "Enter or Select the name of an existing Azure App Service"
},
{
"name": "ResourceGroupName",
"name": "resourceGroupName",
"type": "pickList",
"label": "Resource group",
"defaultValue": "",
Expand Down Expand Up @@ -118,30 +119,30 @@
],
"dataSourceBindings": [
{
"target": "WebAppName",
"target": "appName",
"endpointId": "$(ConnectedServiceName)",
"dataSourceName": "AzureRMWebAppNames"
},
{
"target": "ResourceGroupName",
"target": "resourceGroupName",
"endpointId": "$(ConnectedServiceName)",
"dataSourceName": "AzureRMWebAppResourceGroup",
"parameters": {
"WebAppName": "$(WebAppName)"
"WebAppName": "$(appName)"
}
},
{
"target": "slotName",
"endpointId": "$(ConnectedServiceName)",
"dataSourceName": "AzureRMWebAppSlotsId",
"parameters": {
"WebAppName": "$(WebAppName)",
"ResourceGroupName": "$(ResourceGroupName)"
"WebAppName": "$(appName)",
"ResourceGroupName": "$(resourceGroupName)"
},
"resultTemplate": "{\"Value\":\"{{{ #extractResource slots}}}\",\"DisplayValue\":\"{{{ #extractResource slots}}}\"}"
}
],
"instanceNameFormat": "Azure App Service Settings: $(WebAppName)",
"instanceNameFormat": "Azure App Service Settings: $(appName)",
"execution": {
"Node": {
"target": "azurewebappsettings.js"
Expand Down Expand Up @@ -169,6 +170,7 @@
"FailedToUpdateAppServiceConfiguration": "Failed to update App service '%s' configuration. Error: %s",
"FailedToGetAppServiceConfiguration": "Failed to get App service '%s' configuration. Error: %s",
"FailedToGetAppServicePublishingCredentials": "Failed to fetch App Service '%s' publishing credentials. Error: %s",
"FailedToGetAppServiceApplicationSettings": "Failed to get App service '%s' application settings. Error: %s"
"FailedToGetAppServiceApplicationSettings": "Failed to get App service '%s' application settings. Error: %s",
"AppServiceSettingsNotEnabled" : "App Service Settings is not enabled. Please provide one of the following : App Settings or General Settings or Connection Strings."
}
}
26 changes: 14 additions & 12 deletions Tasks/AzureAppServiceSettingsV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"Minor": 0,
"Patch": 0
},
"preview": "true",
"minimumAgentVersion": "2.104.1",
"groups": [
{
Expand All @@ -41,26 +42,26 @@
"helpMarkDown": "ms-resource:loc.input.help.ConnectedServiceName"
},
{
"name": "WebAppName",
"name": "appName",
"type": "pickList",
"label": "ms-resource:loc.input.label.WebAppName",
"label": "ms-resource:loc.input.label.appName",
"defaultValue": "",
"required": true,
"properties": {
"EditableOptions": "True"
},
"helpMarkDown": "ms-resource:loc.input.help.WebAppName"
"helpMarkDown": "ms-resource:loc.input.help.appName"
},
{
"name": "ResourceGroupName",
"name": "resourceGroupName",
"type": "pickList",
"label": "ms-resource:loc.input.label.ResourceGroupName",
"label": "ms-resource:loc.input.label.resourceGroupName",
"defaultValue": "",
"required": true,
"properties": {
"EditableOptions": "True"
},
"helpMarkDown": "ms-resource:loc.input.help.ResourceGroupName"
"helpMarkDown": "ms-resource:loc.input.help.resourceGroupName"
},
{
"name": "slotName",
Expand Down Expand Up @@ -118,25 +119,25 @@
],
"dataSourceBindings": [
{
"target": "WebAppName",
"target": "appName",
"endpointId": "$(ConnectedServiceName)",
"dataSourceName": "AzureRMWebAppNames"
},
{
"target": "ResourceGroupName",
"target": "resourceGroupName",
"endpointId": "$(ConnectedServiceName)",
"dataSourceName": "AzureRMWebAppResourceGroup",
"parameters": {
"WebAppName": "$(WebAppName)"
"WebAppName": "$(appName)"
}
},
{
"target": "slotName",
"endpointId": "$(ConnectedServiceName)",
"dataSourceName": "AzureRMWebAppSlotsId",
"parameters": {
"WebAppName": "$(WebAppName)",
"ResourceGroupName": "$(ResourceGroupName)"
"WebAppName": "$(appName)",
"ResourceGroupName": "$(resourceGroupName)"
},
"resultTemplate": "{\"Value\":\"{{{ #extractResource slots}}}\",\"DisplayValue\":\"{{{ #extractResource slots}}}\"}"
}
Expand Down Expand Up @@ -169,6 +170,7 @@
"FailedToUpdateAppServiceConfiguration": "ms-resource:loc.messages.FailedToUpdateAppServiceConfiguration",
"FailedToGetAppServiceConfiguration": "ms-resource:loc.messages.FailedToGetAppServiceConfiguration",
"FailedToGetAppServicePublishingCredentials": "ms-resource:loc.messages.FailedToGetAppServicePublishingCredentials",
"FailedToGetAppServiceApplicationSettings": "ms-resource:loc.messages.FailedToGetAppServiceApplicationSettings"
"FailedToGetAppServiceApplicationSettings": "ms-resource:loc.messages.FailedToGetAppServiceApplicationSettings",
"AppServiceSettingsNotEnabled": "ms-resource:loc.messages.AppServiceSettingsNotEnabled"
}
}