Skip to content

Commit

Permalink
Revert "remove container input" (#9951)
Browse files Browse the repository at this point in the history
This reverts commit f3646c2.
  • Loading branch information
vincent1173 authored Mar 27, 2019
1 parent f3646c2 commit a1817b7
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
16 changes: 14 additions & 2 deletions Tasks/AzureWebAppContainerV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"version": {
"Major": 1,
"Minor": 0,
"Patch": 7
"Patch": 6
},
"minimumAgentVersion": "2.104.1",
"groups": [
Expand All @@ -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",
Expand Down Expand Up @@ -131,7 +143,7 @@
{
"target": "appName",
"endpointId": "$(azureSubscription)",
"dataSourceName": "AzureWebAppContainerNames",
"dataSourceName": "AzureWebAppContainerNamesByOSType",
"parameters": {
"osType": "$(osType)"
}
Expand Down
13 changes: 12 additions & 1 deletion Tasks/AzureWebAppContainerV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -131,7 +142,7 @@
{
"target": "appName",
"endpointId": "$(azureSubscription)",
"dataSourceName": "AzureWebAppContainerNames",
"dataSourceName": "AzureWebAppContainerNamesByOSType",
"parameters": {
"osType": "$(osType)"
}
Expand Down
14 changes: 8 additions & 6 deletions Tasks/AzureWebAppContainerV1/taskparameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -39,21 +40,22 @@ export class TaskParametersUtility {
}

private static async getWebAppKind(taskParameters: TaskParameters): Promise<any> {
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
Expand All @@ -64,7 +66,7 @@ export class TaskParametersUtility {
export interface TaskParameters {
azureEndpoint?: AzureEndpoint;
connectedServiceName: string;
OSType?: string;
OSType: string;
WebAppName: string;
AppSettings?: string;
StartupCommand?: string;
Expand Down

0 comments on commit a1817b7

Please sign in to comment.