Skip to content

webapp: Stop executing if an exception is thrown when adding a custom domain to a website. #10422

@jocawtho

Description

@jocawtho

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


Metadata

Metadata

Assignees

Labels

App Servicesaka WebSitesService AttentionThis issue is responsible by Azure service team.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions