Phantom WebApp is neither deleted nor working

107 Views Asked by At

I have been through a bit of a reorganisation of my WebApps which lead to some renaming and creation/deletion cycles. During this I created one WebApp which I subsequently deleted.

However, this WebApp still shows up in my list in VS Code and still shows up in the CLI when I run 'az webapp list'. However It does not show up in my list of resources on the Portal, and I cannot delete it from either VS Code or the CLI. The error I get is:

{"error":{"code":"ResourceNotFound","message":"The Resource 'Microsoft.Web/sites/xxxx' under resource group 'rgr_xxx' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"}}

Any ideas how to delete this for good would be gratefully received!

2

There are 2 best solutions below

0
On BEST ANSWER

So after waiting a week or so the phantom app turned up in my Azure Portal again. I was able to delete it as you would normally, and confirmed it's gone as I can now reuse the app name.

So the solution is... just wait it out and I guess it gets picked up in a periodic clean-up process?

2
On

Thanks for asking question! As you mentioned “ I have been through a bit of a reorganisation of my WebApps”. There is possibility if you have created legacy API/Logic apps you ran into this issue. This features required a "hidden" artifact that would sometimes stay behind preventing the App Service Plan from being deleted.

Try executing below PowerShell script like this one:

Get-AzureRmAppServicePlan -Name <App Service Plan Name> Get-AzureRmWebApp foreach($app in $apps) {if($app.ServerFarmId = $appserviceplan.Id) { $app.Name} }

This would give you a list of all apps (hidden or not) hosted on that app service plan.

You can then delete the apps using below command:

Remove-AzureRmWebApp -Name <App Name>

Check: https://feedback.azure.com/forums/169385-web-apps/suggestions/9496317-can-t-delete-service-plan-even-though-all-apps-hav