Where is it best to set the environment name for each deployment of a ASP.NET 5 web application when publishing to Azure Web Apps?
I understand that the ASPNET_DEV
environment variable needs to be set. Is this possible on publish?
This is our powershell publish script:
param($websiteName, $packOutput)
$website = Get-AzureWebsite -Name $websiteName
# get the scm url to use with MSDeploy. By default this will be the second in the array
$msdeployurl = $website.EnabledHostNames[1]
$publishProperties = @{'WebPublishMethod'='MSDeploy';
'MSDeployServiceUrl'=$msdeployurl;
'DeployIisAppPath'=$website.Name;
'Username'=$website.PublishingUsername;
'Password'=$website.PublishingPassword}
Write-Output "Restarting web app..."
Restart-AzureWebsite -Name $websiteName
Write-Output "Publishing web app..."
$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
Or do we have set the environmental variable in the Azure portal? Will this persist between deployments?
I am using the ASP.NET 5 beta6 libraries with the dnx451
target framework, if that matters.