Set host names for Azure sites through Azure Powershell

I am trying to use PowerShell to assign nodes to an instance of an Azure website. I checked that the domain / host I want to add is valid and even went to the Azure portal to make sure it is defined as valid. For some reason, although the script below does not install HostNames, I suppose it should and when I check after setting a new value on HostNames, it is exactly the same as before. Can someone tell me what I'm doing wrong in a script?

$newHosts = @("mysite.azurewebsites.net","www.mysite.com") $result = Get-AzureWebsite -Name mysite | Set-AzureWebsite -HostNames $newHosts 

I distracted my real instance and domain names for an example.

+5
powershell azure azure-web-sites
source share
1 answer

Turns out you shouldn't include the name of the assigned azure name (mysite.azurewebsites.net) and only include your own user hosts. This is not a mistake, it just won’t do anything if you turn on the designated azure node.

+4
source share

All Articles