From dfbab06402fab7feacdb8c348de0622123f3e3b1 Mon Sep 17 00:00:00 2001 From: Ajay Yadav Date: Thu, 9 Jun 2016 21:40:31 +0530 Subject: [PATCH 1/2] Instead of hard coding kudu url get it from publish profile --- Tasks/AzureRmWebAppDeployment/AzureUtility.ps1 | 12 +++--------- Tasks/AzureRmWebAppDeployment/AzureUtilityGTE1.0.ps1 | 4 ++-- Tasks/AzureRmWebAppDeployment/AzureUtilityLTE9.8.ps1 | 4 ++-- Tasks/AzureRmWebAppDeployment/task.json | 2 +- Tasks/AzureRmWebAppDeployment/task.loc.json | 2 +- 5 files changed, 9 insertions(+), 15 deletions(-) diff --git a/Tasks/AzureRmWebAppDeployment/AzureUtility.ps1 b/Tasks/AzureRmWebAppDeployment/AzureUtility.ps1 index 12f42d5f377f..c5386e43e5e7 100644 --- a/Tasks/AzureRmWebAppDeployment/AzureUtility.ps1 +++ b/Tasks/AzureRmWebAppDeployment/AzureUtility.ps1 @@ -11,7 +11,7 @@ function Get-AzureUtility $azureUtilityNewVersion = "AzureUtilityGTE1.0.ps1" - if( !$currentVersion -and $currentVersion -gt $minimumAzureVersion ) + if( $currentVersion -and $currentVersion -gt $minimumAzureVersion ) { $azureUtilityRequiredVersion = $azureUtilityNewVersion } @@ -60,14 +60,11 @@ function Get-AzureRMWebAppConnectionDetailsWithSpecificSlot Write-Host (Get-VstsLocString -Key "GettingconnectiondetailsforazureRMWebApp0underSlot1" -ArgumentList $webAppName, $slotName) - $kuduHostName = $webAppName + "-" + $slotName + ".scm.azurewebsites.net" - Write-Verbose "`t Using KuduHostName:'$kuduHostName' for azureRM WebApp:'$webAppName' under Slot:'$slotName'." - # Get webApp publish profile Object for MSDeploy $webAppProfileForMSDeploy = Get-AzureRMWebAppProfileForMSDeployWithSpecificSlot -webAppName $webAppName -resourceGroupName $resourceGroupName -slotName $slotName # construct object to store webApp connection details - $azureRMWebAppConnectionDetailsWithSpecificSlot = Construct-AzureWebAppConnectionObject -kuduHostName $kuduHostName -webAppProfileForMSDeploy $webAppProfileForMSDeploy + $azureRMWebAppConnectionDetailsWithSpecificSlot = Construct-AzureWebAppConnectionObject -webAppProfileForMSDeploy $webAppProfileForMSDeploy Write-Host (Get-VstsLocString -Key "GotconnectiondetailsforazureRMWebApp0underSlot1" -ArgumentList $webAppName, $slotName) return $azureRMWebAppConnectionDetailsWithSpecificSlot @@ -79,9 +76,6 @@ function Get-AzureRMWebAppConnectionDetailsWithProductionSlot Write-Host (Get-VstsLocString -Key "GettingconnectiondetailsforazureRMWebApp0underProductionSlot" -ArgumentList $webAppName) - $kuduHostName = $webAppName + ".scm.azurewebsites.net" - Write-Verbose "`t Using KuduHostName:'$kuduHostName' for azureRM WebApp:'$webAppName' under default Slot." - # Get azurerm webApp details $azureRMWebAppDetails = Get-AzureRMWebAppDetails -webAppName $webAppName @@ -100,7 +94,7 @@ function Get-AzureRMWebAppConnectionDetailsWithProductionSlot $webAppProfileForMSDeploy = Get-AzureRMWebAppProfileForMSDeployWithProductionSlot -webAppName $webAppName -resourceGroupName $resourceGroupName # construct object to store webApp connection details - $azureRMWebAppConnectionDetailsWithProductionSlot = Construct-AzureWebAppConnectionObject -kuduHostName $kuduHostName -webAppProfileForMSDeploy $webAppProfileForMSDeploy + $azureRMWebAppConnectionDetailsWithProductionSlot = Construct-AzureWebAppConnectionObject -webAppProfileForMSDeploy $webAppProfileForMSDeploy Write-Host (Get-VstsLocString -Key "GotconnectiondetailsforazureRMWebApp0underProductionSlot" -ArgumentList $webAppName) return $azureRMWebAppConnectionDetailsWithProductionSlot diff --git a/Tasks/AzureRmWebAppDeployment/AzureUtilityGTE1.0.ps1 b/Tasks/AzureRmWebAppDeployment/AzureUtilityGTE1.0.ps1 index b3da08173dd8..a511d0860ddc 100644 --- a/Tasks/AzureRmWebAppDeployment/AzureUtilityGTE1.0.ps1 +++ b/Tasks/AzureRmWebAppDeployment/AzureUtilityGTE1.0.ps1 @@ -104,12 +104,12 @@ function Get-AzureRMWebAppSlotPublishingProfileARM function Construct-AzureWebAppConnectionObject { - param([String][Parameter(Mandatory=$true)] $kuduHostName, - [Object][Parameter(Mandatory=$true)] $webAppProfileForMSDeploy) + param([Object][Parameter(Mandatory=$true)] $webAppProfileForMSDeploy) # Get userName and userPassword to access kuduServer $userName = $webAppProfileForMSDeploy.userName $userPassword = $webAppProfileForMSDeploy.userPWD + $kuduHostName = $webAppProfileForMSDeploy.PublishUrl Write-Verbose "`t Username is:'$userName' to access KuduHostName:'$kuduHostName'." $azureRMWebAppConnectionDetails = @{} diff --git a/Tasks/AzureRmWebAppDeployment/AzureUtilityLTE9.8.ps1 b/Tasks/AzureRmWebAppDeployment/AzureUtilityLTE9.8.ps1 index 33582f0d8b72..f92a2d6ef29b 100644 --- a/Tasks/AzureRmWebAppDeployment/AzureUtilityLTE9.8.ps1 +++ b/Tasks/AzureRmWebAppDeployment/AzureUtilityLTE9.8.ps1 @@ -79,12 +79,12 @@ function Get-WebAppRGName function Construct-AzureWebAppConnectionObject { - param([String][Parameter(Mandatory=$true)] $kuduHostName, - [Object][Parameter(Mandatory=$true)] $webAppProfileForMSDeploy) + param([Object][Parameter(Mandatory=$true)] $webAppProfileForMSDeploy) # Get userName and userPassword to access kuduServer $userName = $webAppProfileForMSDeploy.userName $userPassword = $webAppProfileForMSDeploy.UserPassword + $kuduHostName = $webAppProfileForMSDeploy.PublishUrl Write-Verbose "`t Username is:'$userName' to access KuduHostName:'$kuduHostName'." $azureRMWebAppConnectionDetails = @{} diff --git a/Tasks/AzureRmWebAppDeployment/task.json b/Tasks/AzureRmWebAppDeployment/task.json index a32daf3d9715..569dd1d73980 100644 --- a/Tasks/AzureRmWebAppDeployment/task.json +++ b/Tasks/AzureRmWebAppDeployment/task.json @@ -13,7 +13,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 7 + "Patch": 8 }, "minimumAgentVersion": "1.99.0", "groups": [ diff --git a/Tasks/AzureRmWebAppDeployment/task.loc.json b/Tasks/AzureRmWebAppDeployment/task.loc.json index 2cb56cab3735..dbbe04e2b91c 100644 --- a/Tasks/AzureRmWebAppDeployment/task.loc.json +++ b/Tasks/AzureRmWebAppDeployment/task.loc.json @@ -13,7 +13,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 7 + "Patch": 8 }, "minimumAgentVersion": "1.99.0", "groups": [ From f758e135bdfae086bff5fc6531edbf5be44beb4e Mon Sep 17 00:00:00 2001 From: Ajay Yadav Date: Fri, 10 Jun 2016 08:48:08 +0530 Subject: [PATCH 2/2] changes in legacy code for kudu url service --- .../LegacyUtils/AzureUtility-Legacy.ps1 | 10 ++-------- .../LegacyUtils/AzureUtilityGTE1.0-Legacy.ps1 | 4 ++-- .../LegacyUtils/AzureUtilityLTE9.8-Legacy.ps1 | 4 ++-- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/Tasks/AzureRmWebAppDeployment/LegacyUtils/AzureUtility-Legacy.ps1 b/Tasks/AzureRmWebAppDeployment/LegacyUtils/AzureUtility-Legacy.ps1 index e6498f676fda..eded920b2221 100644 --- a/Tasks/AzureRmWebAppDeployment/LegacyUtils/AzureUtility-Legacy.ps1 +++ b/Tasks/AzureRmWebAppDeployment/LegacyUtils/AzureUtility-Legacy.ps1 @@ -60,14 +60,11 @@ function Get-AzureRMWebAppConnectionDetailsWithSpecificSlot Write-Host (Get-LocalizedString -Key "Getting connection details for azureRM WebApp:'{0}' under Slot:'{1}'." -ArgumentList $webAppName, $slotName) - $kuduHostName = $webAppName + "-" + $slotName + ".scm.azurewebsites.net" - Write-Verbose "`t Using KuduHostName:'$kuduHostName' for azureRM WebApp:'$webAppName' under Slot:'$slotName'." - # Get webApp publish profile Object for MSDeploy $webAppProfileForMSDeploy = Get-AzureRMWebAppProfileForMSDeployWithSpecificSlot -webAppName $webAppName -resourceGroupName $resourceGroupName -slotName $slotName # construct object to store webApp connection details - $azureRMWebAppConnectionDetailsWithSpecificSlot = Construct-AzureWebAppConnectionObject -kuduHostName $kuduHostName -webAppProfileForMSDeploy $webAppProfileForMSDeploy + $azureRMWebAppConnectionDetailsWithSpecificSlot = Construct-AzureWebAppConnectionObject -webAppProfileForMSDeploy $webAppProfileForMSDeploy Write-Host (Get-LocalizedString -Key "Got connection details for azureRM WebApp:'{0}' under Slot:'{1}'." -ArgumentList $webAppName, $slotName) return $azureRMWebAppConnectionDetailsWithSpecificSlot @@ -79,9 +76,6 @@ function Get-AzureRMWebAppConnectionDetailsWithProductionSlot Write-Host (Get-LocalizedString -Key "Getting connection details for azureRM WebApp:'{0}' under Production Slot." -ArgumentList $webAppName) - $kuduHostName = $webAppName + ".scm.azurewebsites.net" - Write-Verbose "`t Using KuduHostName:'$kuduHostName' for azureRM WebApp:'$webAppName' under default Slot." - # Get azurerm webApp details $azureRMWebAppDetails = Get-AzureRMWebAppDetails -webAppName $webAppName @@ -100,7 +94,7 @@ function Get-AzureRMWebAppConnectionDetailsWithProductionSlot $webAppProfileForMSDeploy = Get-AzureRMWebAppProfileForMSDeployWithProductionSlot -webAppName $webAppName -resourceGroupName $resourceGroupName # construct object to store webApp connection details - $azureRMWebAppConnectionDetailsWithProductionSlot = Construct-AzureWebAppConnectionObject -kuduHostName $kuduHostName -webAppProfileForMSDeploy $webAppProfileForMSDeploy + $azureRMWebAppConnectionDetailsWithProductionSlot = Construct-AzureWebAppConnectionObject -webAppProfileForMSDeploy $webAppProfileForMSDeploy Write-Host (Get-LocalizedString -Key "Got connection details for azureRM WebApp:'{0}' under Production Slot." -ArgumentList $webAppName) return $azureRMWebAppConnectionDetailsWithProductionSlot diff --git a/Tasks/AzureRmWebAppDeployment/LegacyUtils/AzureUtilityGTE1.0-Legacy.ps1 b/Tasks/AzureRmWebAppDeployment/LegacyUtils/AzureUtilityGTE1.0-Legacy.ps1 index 93becd10d250..b40713f9f361 100644 --- a/Tasks/AzureRmWebAppDeployment/LegacyUtils/AzureUtilityGTE1.0-Legacy.ps1 +++ b/Tasks/AzureRmWebAppDeployment/LegacyUtils/AzureUtilityGTE1.0-Legacy.ps1 @@ -104,12 +104,12 @@ function Get-AzureRMWebAppSlotPublishingProfileARM function Construct-AzureWebAppConnectionObject { - param([String][Parameter(Mandatory=$true)] $kuduHostName, - [Object][Parameter(Mandatory=$true)] $webAppProfileForMSDeploy) + param([Object][Parameter(Mandatory=$true)] $webAppProfileForMSDeploy) # Get userName and userPassword to access kuduServer $userName = $webAppProfileForMSDeploy.userName $userPassword = $webAppProfileForMSDeploy.userPWD + $kuduHostName = $webAppProfileForMSDeploy.PublishUrl Write-Verbose "`t Username is:'$userName' to access KuduHostName:'$kuduHostName'." $azureRMWebAppConnectionDetails = @{} diff --git a/Tasks/AzureRmWebAppDeployment/LegacyUtils/AzureUtilityLTE9.8-Legacy.ps1 b/Tasks/AzureRmWebAppDeployment/LegacyUtils/AzureUtilityLTE9.8-Legacy.ps1 index bae6ebbadfe2..bf384c6d4638 100644 --- a/Tasks/AzureRmWebAppDeployment/LegacyUtils/AzureUtilityLTE9.8-Legacy.ps1 +++ b/Tasks/AzureRmWebAppDeployment/LegacyUtils/AzureUtilityLTE9.8-Legacy.ps1 @@ -79,12 +79,12 @@ function Get-WebAppRGName function Construct-AzureWebAppConnectionObject { - param([String][Parameter(Mandatory=$true)] $kuduHostName, - [Object][Parameter(Mandatory=$true)] $webAppProfileForMSDeploy) + param([Object][Parameter(Mandatory=$true)] $webAppProfileForMSDeploy) # Get userName and userPassword to access kuduServer $userName = $webAppProfileForMSDeploy.userName $userPassword = $webAppProfileForMSDeploy.UserPassword + $kuduHostName = $webAppProfileForMSDeploy.PublishUrl Write-Verbose "`t Username is:'$userName' to access KuduHostName:'$kuduHostName'." $azureRMWebAppConnectionDetails = @{}