Closed johnkors closed 1 year ago
Sorry about the snark, but why is adding/removing a custom domain such a pain in the ass. The same process take seconds in App Service (or more relevant, the competion: Vercel, Netlify). Is it because of GoDaddy or what?
I have exactly the same problem, since yesterday.
I have the same issue, unfortunately, it's stuck forever
I came to report this as well. Mine isn't just taking minutes, it's forever. The only way I can remove a custom domain at the moment is to delete the SWA itself and recreate it. I've tried two subscriptions and both have the same issue.
@StacyCash Deleting the SWA itself would probably delete the custom domain first, anyways? Or is that quicker in your experience?
For me it wasn't just quicker, it was the only way. That said deleting the SWA also took several attempts.
But I have to update my other statement: in my MVP Subscription deleting just doesn't happen, in my private subscription it simply takes 20 minutes or more to delete.
@johnkors Ran into the same problem with a domain taking hours to delete. and utilized a little brute force with PowerShell. Still takes a while... but the automation helps and I'm seeing ~20 mins like @StacyCash.
$rg = "<resource-group>";
$name = "<static-webapp>";
$remove_me = "sub.domain.com";
$domains = Get-AzStaticWebAppCustomDomain -ResourceGroupName $rg -Name $name;
$len = $domains.Length;
while($len -eq $domains.Length){
foreach($item in $domains){
if($item.name -eq $remove_me){
$err = Remove-AzStaticWebAppCustomDomain -DomainName $remove_me -Name $name -ResourceGroupName $rg -NoWait;
$domains = Get-AzStaticWebAppCustomDomain -ResourceGroupName $rg -Name $name;
if($domains.Length -gt 0){
Write-Host "$remove_me still exists. Retrying...";
Start-Sleep -s 10;
}
}
}
}
Write-Host "Success!";
Yeah, same — except we're using Pulumi for managing the infra on our end.
I had the same problem. The previous mentioned workarounds didn't work for me. What worked for me was to first delete the deployment and after that delete the static web app. Whenever I tried to delete the static web app first, it just reappeared after a few minutes with the status of the custom domain still as deleting.
Also having this issue and unable to delete the SWAs involved or reclaim their domains for use in another resource.
It seems this Stack Overflow post and this Microsoft Learn post are referring to the same issue.
@vgibilmanno how did you get to delete the deployment? On the resource group level, I've deleted the deployments for the SWA, and if I go into the Environments blade within the resource, it just shows "production" as perpetually deleting.
@kjkent That's exactly how I did it. I went to the deployment option in the resource group blade, selected the SWA deployment and deleted it.
Interesting workaround. Thanks.
@vgibilmanno thanks for the explanation -- unfortunately I was locked out of doing that by a perpetual deleting status! All hope was not lost -- @deathmarine's script (thank you!) actually worked wonders; in ten mins, two days of trying to fix this was over!
I didn't get around to trying the other options, but I did just try doing it again in the portal (it was still on deleting after a month or more) and it was super quick again (<30 seconds). So I don't know if something has been fixed in the background...
I didn't get around to trying the other options, but I did just try doing it again in the portal (it was still on deleting after a month or more) and it was super quick again (<30 seconds). So I don't know if something has been fixed in the background...
Me, too! I've just tried again, it works, deleted in 20 seconds.
This issue should now be fixed. Let us know if you still face issues. Thanks for being patient!
@Reshmi-Sriram Dealing with this issue as well, two years laters, even opened a support ticket. Our website is down, can't do anything... am also running the script pasted above and getting internal errors from Azure's API. Can't delete the custom domains, can't delete the Static Web App. Please help!
To Reproduce Steps to reproduce the behavior:
. . . . WAIT 24 HOURS
[still not deleted 😴]
WAIT ..
💤
. . Go to work next day. Grab a coffee ☕️ Try to delete the domain the deleting state.
See errors. . . . . WAIT ANOTHER COUPLE OF HOURS. . . .
Expected behavior A custom domain should be able to be removed within minutes.