Skip to content

Commit

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

private static async getWebAppKind(taskParameters: TaskParameters): Promise<any> {
var resourceGroupName = taskParameters.ResourceGroupName;
var osType = taskParameters.OSType;
let resourceGroupName: string = taskParameters.ResourceGroupName;
let osType: string;
if (!resourceGroupName) {
var appDetails = await AzureResourceFilterUtility.getAppDetails(taskParameters.azureEndpoint, taskParameters.WebAppName);
resourceGroupName = appDetails["resourceGroupName"];
if(!osType) {
osType = osTypeMap.get(appDetails["kind"]) ? osTypeMap.get(appDetails["kind"]) : appDetails["kind"];
}
osType = osTypeMap.get(appDetails["kind"]) ? osTypeMap.get(appDetails["kind"]) : appDetails["kind"];

tl.debug(`Resource Group: ${resourceGroupName}`);
}
else if(!osType) {
else {
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 @@ -66,7 +64,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 f3646c2

Please sign in to comment.