From c1651d6301853b5d1e163ea2ddb51262a23cb0b2 Mon Sep 17 00:00:00 2001 From: Eavanshi Arora Date: Thu, 21 Nov 2019 18:11:00 +0530 Subject: [PATCH 1/4] Changes for slotname --- Tasks/AzureAppServiceManageV0/azureappservicemanage.ts | 7 +++++++ Tasks/AzureAppServiceManageV0/task.json | 2 +- Tasks/AzureAppServiceManageV0/task.loc.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Tasks/AzureAppServiceManageV0/azureappservicemanage.ts b/Tasks/AzureAppServiceManageV0/azureappservicemanage.ts index 37391de82716..4e88f5d27d84 100644 --- a/Tasks/AzureAppServiceManageV0/azureappservicemanage.ts +++ b/Tasks/AzureAppServiceManageV0/azureappservicemanage.ts @@ -86,6 +86,13 @@ async function run() { } tl.debug(`Resource Group: ${resourceGroupName}`); + let appServiceSlotName: boolean = (action == "Start Azure App Service" || action == "Stop Azure App Service" || action == "Restart Azure App Service") && !specifySlotFlag; + let slotNameNotNeeded: boolean = (action == "Complete Swap" || action == "Swap Slots" || action == "Start Swap With Preview"); + if(appServiceSlotName || slotNameNotNeeded) + { + slotName = "production"; + } + appService = new AzureAppService(azureEndpoint, resourceGroupName, webAppName, slotName); azureAppServiceUtils = new AzureAppServiceUtils(appService); let appServiceKuduService = await azureAppServiceUtils.getKuduService(); diff --git a/Tasks/AzureAppServiceManageV0/task.json b/Tasks/AzureAppServiceManageV0/task.json index 5af43c5d9799..b2c5609a3512 100644 --- a/Tasks/AzureAppServiceManageV0/task.json +++ b/Tasks/AzureAppServiceManageV0/task.json @@ -19,7 +19,7 @@ "version": { "Major": 0, "Minor": 2, - "Patch": 62 + "Patch": 63 }, "minimumAgentVersion": "1.102.0", "instanceNameFormat": "$(Action): $(WebAppName)", diff --git a/Tasks/AzureAppServiceManageV0/task.loc.json b/Tasks/AzureAppServiceManageV0/task.loc.json index 5f0732e3e891..211fdeb92978 100644 --- a/Tasks/AzureAppServiceManageV0/task.loc.json +++ b/Tasks/AzureAppServiceManageV0/task.loc.json @@ -19,7 +19,7 @@ "version": { "Major": 0, "Minor": 2, - "Patch": 62 + "Patch": 63 }, "minimumAgentVersion": "1.102.0", "instanceNameFormat": "ms-resource:loc.instanceNameFormat", From c8012427aa54371961331ffcccb6d7642acaaccd Mon Sep 17 00:00:00 2001 From: Eavanshi Arora Date: Tue, 26 Nov 2019 15:43:12 +0530 Subject: [PATCH 2/4] Slot name changes --- Tasks/AzureAppServiceManageV0/azureappservicemanage.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Tasks/AzureAppServiceManageV0/azureappservicemanage.ts b/Tasks/AzureAppServiceManageV0/azureappservicemanage.ts index 4e88f5d27d84..590f4064ce83 100644 --- a/Tasks/AzureAppServiceManageV0/azureappservicemanage.ts +++ b/Tasks/AzureAppServiceManageV0/azureappservicemanage.ts @@ -86,12 +86,9 @@ async function run() { } tl.debug(`Resource Group: ${resourceGroupName}`); - let appServiceSlotName: boolean = (action == "Start Azure App Service" || action == "Stop Azure App Service" || action == "Restart Azure App Service") && !specifySlotFlag; + let slotNameNotNeeded: boolean = (action == "Complete Swap" || action == "Swap Slots" || action == "Start Swap With Preview"); - if(appServiceSlotName || slotNameNotNeeded) - { - slotName = "production"; - } + slotName = (!specifySlotFlag || slotNameNotNeeded) ? "production" : slotName; appService = new AzureAppService(azureEndpoint, resourceGroupName, webAppName, slotName); azureAppServiceUtils = new AzureAppServiceUtils(appService); From a9e3c0f2bc305d68bf439b288cc4ea59125e5552 Mon Sep 17 00:00:00 2001 From: Eavanshi Arora Date: Wed, 27 Nov 2019 11:00:10 +0530 Subject: [PATCH 3/4] patch update --- Tasks/AzureAppServiceManageV0/task.json | 2 +- Tasks/AzureAppServiceManageV0/task.loc.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tasks/AzureAppServiceManageV0/task.json b/Tasks/AzureAppServiceManageV0/task.json index b2c5609a3512..6ab85dbb0825 100644 --- a/Tasks/AzureAppServiceManageV0/task.json +++ b/Tasks/AzureAppServiceManageV0/task.json @@ -19,7 +19,7 @@ "version": { "Major": 0, "Minor": 2, - "Patch": 63 + "Patch": 64 }, "minimumAgentVersion": "1.102.0", "instanceNameFormat": "$(Action): $(WebAppName)", diff --git a/Tasks/AzureAppServiceManageV0/task.loc.json b/Tasks/AzureAppServiceManageV0/task.loc.json index 211fdeb92978..1e1a8599e4af 100644 --- a/Tasks/AzureAppServiceManageV0/task.loc.json +++ b/Tasks/AzureAppServiceManageV0/task.loc.json @@ -19,7 +19,7 @@ "version": { "Major": 0, "Minor": 2, - "Patch": 63 + "Patch": 64 }, "minimumAgentVersion": "1.102.0", "instanceNameFormat": "ms-resource:loc.instanceNameFormat", From b0a0a0fe6eb01cbff4bc3f9527cf9eb8840698ba Mon Sep 17 00:00:00 2001 From: Eavanshi Arora Date: Thu, 28 Nov 2019 12:06:37 +0530 Subject: [PATCH 4/4] Comments resolved --- Tasks/AzureAppServiceManageV0/azureappservicemanage.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tasks/AzureAppServiceManageV0/azureappservicemanage.ts b/Tasks/AzureAppServiceManageV0/azureappservicemanage.ts index 590f4064ce83..5189d145b3a9 100644 --- a/Tasks/AzureAppServiceManageV0/azureappservicemanage.ts +++ b/Tasks/AzureAppServiceManageV0/azureappservicemanage.ts @@ -17,6 +17,7 @@ const webAppKindMap = new Map([ [ 'app,linux', 'webAppLinux' ], [ 'app,container', 'webAppContainer'] ]); +const defaultslotname:string = "production"; async function advancedSlotSwap(updateDeploymentStatus: boolean, appServiceSourceSlot: AzureAppService, appServiceTargetSlot: AzureAppService, appServiceSourceSlotUtils: AzureAppServiceUtils, appServiceTargetSlotUtils: AzureAppServiceUtils) { @@ -88,7 +89,7 @@ async function run() { tl.debug(`Resource Group: ${resourceGroupName}`); let slotNameNotNeeded: boolean = (action == "Complete Swap" || action == "Swap Slots" || action == "Start Swap With Preview"); - slotName = (!specifySlotFlag || slotNameNotNeeded) ? "production" : slotName; + slotName = (!specifySlotFlag || slotNameNotNeeded) ? defaultslotname : slotName; appService = new AzureAppService(azureEndpoint, resourceGroupName, webAppName, slotName); azureAppServiceUtils = new AzureAppServiceUtils(appService);