I'm busy writing some deployment scripts. One of the things this script needs to do is publish a new Azure Website.
To do so, I've already written some lines which create a new Website in Azure. Afterwards, my website has to be deployed. Reading up on this matter it appears this can be done using msbuild
and the DeployOnBuild
parameter.
So far the script looks like a bit like this (simplified):
New-AzureResourceGroup -Location $locationWestEUDataCenter -Name $resourceGroupNameEU
New-AzureResource -ApiVersion 2014-04-01 -Name $hostingPlanNameEU -ResourceGroupName $resourceGroupNameEU `
-ResourceType Microsoft.Web/serverFarms -Location $locationWestEUDataCenter `
-PropertyObject $hostingPlanParametersEU -Verbose -Force
$siteWestEUProperties = @{name = $siteNameEU; sku = "Basic"; webHostingPlan = $hostingPlanNameEU}
New-AzureResource -Name $siteNameEU -ResourceType Microsoft.Web/sites `
-ResourceGroupName $resourceGroupNameEU -Location $locationWestEUDataCenter `
-ApiVersion $apiVersion -PropertyObject $siteWestEUProperties
Switch-AzureMode AzureServiceManagement
The MSBuild publish looks like this at the moment (copy of http://www.asp.net/aspnet/overview/developing-apps-with-windows-azure/building-real-world-cloud-apps-with-windows-azure/automate-everything):
& "$env:windir\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" $websiteProjectFileAnalytics `
/p:VisualStudioVersion=11.0 `
/p:DeployOnBuild=true `
/p:PublishProfile=$publishingFileAnalytics `
/p:Password=$publishSettings.publishData.publishProfile.userPWD.get(0)
The problem I'm having with this line of code is the Password
property. The password has to be retrieved from a PublishSettings file. This passwork isn't present on the subscription PublishSettings file. This password (and a lot of other properties) is present in the PublishSettings file which you can download from the website management page in the Azure portal.
See my problem here?
I want a fully automated deployment of the complete software suite. Is there a way I can set the password of the specific websites I'm creating? If this is possible, I can manage the password in PowerShell and use the password while publishing.
Or is there a different/better way to automate the deployments of Azure Websites?
On a sidenote: I'm a PowerShell newbie, but already succeeded in automatically deploying Cloud Services, Service Busses, database, Traffic Manager, Storage.