The context: In my current role, we use Azure Cloud Services for hosting our solutions. This is due to a decision made a long time ago for out-dated reasons. A decision to move to Azure Websites for next phases is under investigation. Due to this, sometimes I take time to write samples using Azure Websites to address new features & differences between Azure Websites & Azure Cloud Services.
This case happened by accident & I did try not reproduce it. Few days ago, I created a sample Azure Website to experiment the Deployment Slots feature. I added a Deployment Slot, called UAT. From my experiment, I see that a deployment slot is actually another Azure Website but linked, "in a way", to the parent Azure Website, in order to enable the Azure Portal to list them together as a site & deployment slots and also to enable swapping deployment between them. When I finished playing with the site, I deleted all resources, not sure about the order but I did this using the portal "Delete" buttons so what could go wrong?!
After this, Azure Portal started to fail loading the Websites section! I tried the Preview Portal, it was working normally but I have a Web Hosting Plan that I cannot delete! I tried to delete it by Azure xplat-cli and Azure PowerShell but that wasn't possible too! At the beginning, I had doubts that I deleted a required Resource Group during the clean up & the Azure Portal needs this Resource Group to list websites, since that Azure Portal doesn't have the concept of maintaining Resource Groups. I tried to recreate the website again but this didn't help also. Finally, using Azure PowerShell, I was able to list all websites & deployment slots, and I can see that the UAT deployment slot hasn't been deleted but the parent website has been deleted! Using Remove-AzureWebsite <uat-deployment-slot> I managed to delete this orphan slot. After this, portals returned to work as expected and I was able to delete the web hosting plan also.