Skip to content

Commit

Permalink
Merge pull request #1861 from Microsoft/users/ajya/fixIssueOfKuduURl
Browse files Browse the repository at this point in the history
Instead of hard coding kudu url get it from publish profile
  • Loading branch information
Ajay Kumar Yadav authored Jun 10, 2016
2 parents 37168cc + f758e13 commit 4810bb6
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 27 deletions.
12 changes: 3 additions & 9 deletions Tasks/AzureRmWebAppDeployment/AzureUtility.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Tasks/AzureRmWebAppDeployment/AzureUtilityGTE1.0.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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 = @{}
Expand Down
4 changes: 2 additions & 2 deletions Tasks/AzureRmWebAppDeployment/AzureUtilityLTE9.8.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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 = @{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = @{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = @{}
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureRmWebAppDeployment/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 1,
"Minor": 0,
"Patch": 7
"Patch": 8
},
"minimumAgentVersion": "1.99.0",
"groups": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureRmWebAppDeployment/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 1,
"Minor": 0,
"Patch": 7
"Patch": 8
},
"minimumAgentVersion": "1.99.0",
"groups": [
Expand Down

0 comments on commit 4810bb6

Please sign in to comment.