I am running Powershell 5 and trying to manipulate my Azure WebApp object using Set-AzureRmWebApp (and NOT Set-AzureResource) to set the Always On property in the web application.
My basic code snippet starts with a running web application called "myWebApp" and looks like this:
$name = "myWebApp" $resourceGroupName = "myResourceGroup" $app_settings = @{"WEBSITE_LOAD_CERTIFICATES"="*";"CommonDatabase"="Common";"WEBSITE_NODE_DEFAULT_VERSION"="0.10.32"} $result1 = Set-AzureRmWebApp -ResourceGroupName $resourceGroupName -AppSettings $app_settings -Name $name $result2 = Set-AzureRmResource -ResourceGroupName $resourceGroupName -ResourceType Microsoft.Web/sites/config -ResourceName $this.name -PropertyObject $propertiesObject -ApiVersion 2015-08-01 -Force
The first Set-AzureRmWebApp statement works . It sets all the variables in $ app_settings and they become visible on the Azure blade server for myWebApp .
I tried using "Always On" = on as a property in $ app_settings using Set-AzureRmWebApp and appeared in the application settings submenu in the "myWebApp" properties on the Azure portal blade, but the actual "Always On" property remained in the general settings.
I read on another site that using Set-AzureRmResource would work, so I tried, but it failed.
What do I need to do in Powershell to set the property in the general settings of my Azure WebApp, in particular , Always On?
source share