-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Description
Description
When a user makes a mistake in their powershell script. It sometimes results in all their existing custom domains being removed. As part of the WebsiteClient in chaning customDomains the client does a GET to see existing domains, adds new domains, and then Deletes domains that are not included. If a customDomain fails to be added, we should not remove custom domains and should stop that part of the update customDomains code.
Steps to reproduce
I understand that this isnt the newest version, but I forgot to save those commands
$W=Get-AzureRmWebApp -ResourceGroupName "prod-rg" -Name "prod-rg"
$X = $W.hostnames
$X.add("mycustom.domain.com")
$HN = $X.tostring()
Set-AzureRmWebApp -ResourceGroupName "prod-rg" -Name "prod-rg" -HostNames $HN
At this point, X = [oldDomain1, OldDomain2, New domain]
And HN = system.collections.generic.list`1[system.string]
When customer tries to send HN the websites cmdlet sends that one new domain, this fails because this 'domain' is not valid. and then the websites cmdlet continues
Environment data
Module versions
Debug output
Error output