Last active
January 22, 2016 22:12
-
-
Save dibble-james/48990d192b7739b76b46 to your computer and use it in GitHub Desktop.
A Publish script for Azure Websites with multiple hostnames
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param($websiteName, $packOutput) | |
$website = Get-AzureWebsite -Name $websiteName | |
# Debug dump the enabled hostnames on the site to check it has an scm | |
Write-Host "Enabled Host Names" | |
foreach($hostname in $website.EnabledHostNames) | |
{ | |
Write-Host "$hostname`n" | |
} | |
# get the scm url to use with MSDeploy. | |
$msdeployurl = $website.EnabledHostNames | Where { $_.Contains(".scm.") } | Select -First 1 | |
$publishProperties = @{'WebPublishMethod'='MSDeploy'; | |
'MSDeployServiceUrl'=$msdeployurl; | |
'DeployIisAppPath'=$website.Name; | |
'Username'=$website.PublishingUsername; | |
'Password'=$website.PublishingPassword} | |
$publishScript = "${env:ProgramFiles(x86)}\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\Publish\Scripts\default-publish.ps1" | |
. $publishScript -publishProperties $publishProperties -packOutput $packOutput |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment