From a1817b7a457af5414b4c3df5036d869c26aac965 Mon Sep 17 00:00:00 2001 From: "Vincent A (vinca)" Date: Wed, 27 Mar 2019 18:18:39 +0530 Subject: [PATCH] Revert "remove container input" (#9951) This reverts commit f3646c2d7d1003a9a6213ae38caa623f4712cb5b. --- .../resources.resjson/en-US/resources.resjson | 1 + Tasks/AzureWebAppContainerV1/task.json | 16 ++++++++++++++-- Tasks/AzureWebAppContainerV1/task.loc.json | 13 ++++++++++++- Tasks/AzureWebAppContainerV1/taskparameters.ts | 14 ++++++++------ 4 files changed, 35 insertions(+), 9 deletions(-) diff --git a/Tasks/AzureWebAppContainerV1/Strings/resources.resjson/en-US/resources.resjson b/Tasks/AzureWebAppContainerV1/Strings/resources.resjson/en-US/resources.resjson index 1f4c6bcbb9fd..c6a999aebac1 100644 --- a/Tasks/AzureWebAppContainerV1/Strings/resources.resjson/en-US/resources.resjson +++ b/Tasks/AzureWebAppContainerV1/Strings/resources.resjson/en-US/resources.resjson @@ -6,6 +6,7 @@ "loc.group.displayName.ApplicationAndConfigurationSettings": "Application and Configuration Settings", "loc.input.label.azureSubscription": "Azure subscription", "loc.input.help.azureSubscription": "Select the Azure Resource Manager subscription for the deployment.", + "loc.input.label.osType": "App OS type", "loc.input.label.appName": "App name", "loc.input.help.appName": "Enter or Select the name of an existing Azure App Service. App services based on selected app type will only be listed.", "loc.input.label.deployToSlotOrASE": "Deploy to Slot or App Service Environment", diff --git a/Tasks/AzureWebAppContainerV1/task.json b/Tasks/AzureWebAppContainerV1/task.json index 2e8740b87137..e55c1660edbe 100644 --- a/Tasks/AzureWebAppContainerV1/task.json +++ b/Tasks/AzureWebAppContainerV1/task.json @@ -19,7 +19,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 7 + "Patch": 6 }, "minimumAgentVersion": "2.104.1", "groups": [ @@ -38,6 +38,18 @@ "required": true, "helpMarkDown": "Select the Azure Resource Manager subscription for the deployment." }, + { + "name": "osType", + "type": "pickList", + "label": "App OS type", + "defaultValue": "Linux", + "required": true, + "options": { + "Linux": "Linux", + "Windows": "Windows" + + } + }, { "name": "appName", "type": "pickList", @@ -131,7 +143,7 @@ { "target": "appName", "endpointId": "$(azureSubscription)", - "dataSourceName": "AzureWebAppContainerNames", + "dataSourceName": "AzureWebAppContainerNamesByOSType", "parameters": { "osType": "$(osType)" } diff --git a/Tasks/AzureWebAppContainerV1/task.loc.json b/Tasks/AzureWebAppContainerV1/task.loc.json index 4548cf5eb555..ac30ecb14eff 100644 --- a/Tasks/AzureWebAppContainerV1/task.loc.json +++ b/Tasks/AzureWebAppContainerV1/task.loc.json @@ -38,6 +38,17 @@ "required": true, "helpMarkDown": "ms-resource:loc.input.help.azureSubscription" }, + { + "name": "osType", + "type": "pickList", + "label": "ms-resource:loc.input.label.osType", + "defaultValue": "Linux", + "required": true, + "options": { + "Linux": "Linux", + "Windows": "Windows" + } + }, { "name": "appName", "type": "pickList", @@ -131,7 +142,7 @@ { "target": "appName", "endpointId": "$(azureSubscription)", - "dataSourceName": "AzureWebAppContainerNames", + "dataSourceName": "AzureWebAppContainerNamesByOSType", "parameters": { "osType": "$(osType)" } diff --git a/Tasks/AzureWebAppContainerV1/taskparameters.ts b/Tasks/AzureWebAppContainerV1/taskparameters.ts index ce82e6568977..ef3da29cd26c 100644 --- a/Tasks/AzureWebAppContainerV1/taskparameters.ts +++ b/Tasks/AzureWebAppContainerV1/taskparameters.ts @@ -19,6 +19,7 @@ export class TaskParametersUtility { StartupCommand: tl.getInput('containerCommand', false), ConfigurationSettings: tl.getInput('configurationStrings', false), WebAppName: tl.getInput('appName', true), + OSType: tl.getInput('osType', false), DeployToSlotOrASEFlag: tl.getBoolInput('deployToSlotOrASE', false), ResourceGroupName: tl.getInput('resourceGroupName', false), SlotName:tl.getInput('slotName', false) @@ -39,21 +40,22 @@ export class TaskParametersUtility { } private static async getWebAppKind(taskParameters: TaskParameters): Promise { - let resourceGroupName: string = taskParameters.ResourceGroupName; - let osType: string; + var resourceGroupName = taskParameters.ResourceGroupName; + var osType = taskParameters.OSType; if (!resourceGroupName) { var appDetails = await AzureResourceFilterUtility.getAppDetails(taskParameters.azureEndpoint, taskParameters.WebAppName); resourceGroupName = appDetails["resourceGroupName"]; - osType = osTypeMap.get(appDetails["kind"]) ? osTypeMap.get(appDetails["kind"]) : appDetails["kind"]; + if(!osType) { + osType = osTypeMap.get(appDetails["kind"]) ? osTypeMap.get(appDetails["kind"]) : appDetails["kind"]; + } tl.debug(`Resource Group: ${resourceGroupName}`); } - else { + else if(!osType) { var appService = new AzureAppService(taskParameters.azureEndpoint, taskParameters.ResourceGroupName, taskParameters.WebAppName); var configSettings = await appService.get(true); osType = osTypeMap.get(configSettings.kind) ? osTypeMap.get(configSettings.kind) : configSettings.kind; } - return { resourceGroupName: resourceGroupName, osType: osType @@ -64,7 +66,7 @@ export class TaskParametersUtility { export interface TaskParameters { azureEndpoint?: AzureEndpoint; connectedServiceName: string; - OSType?: string; + OSType: string; WebAppName: string; AppSettings?: string; StartupCommand?: string;