Hi @Aliaksandr Urbanovich1 thanks for the question.
one way to force the deletion of the WebApp1 that was created under Dir1 and Subscription1, is to use the Remove-AzResource PowerShell command. before using this command ensure that you have the necessary permissions to delete the web app.
Here are the steps you can follow:
- Connect to the Azure portal using PowerShell and switch to the subscription where the WebApp1 was created:
powershellCopy code Connect-AzAccount Set-AzContext -SubscriptionId <SubscriptionId> ``` 1. Retrieve the deleted WebApp1 using the Get-AzDeletedWebApp command:
powershellCopy code $deletedWebApp = Get-AzDeletedWebApp -ResourceGroupName <ResourceGroupName> -Name WebApp1 ``` Replace <ResourceGroupName> with the name of the resource group where the WebApp1 was created.
- Remove the deleted WebApp1 using the Remove-AzResource command:
powershellCopy code Remove-AzResource -ResourceId $deletedWebApp.ResourceId -Force ``` This will permanently delete the WebApp1 and free up the name for you to use again under Dir2 and Subscription2. A few important things to note: -the Remove-AzResource command is a powerful command that can delete any Azure resource, so ***make sure*** you have the correct resource ID before running this command. -it may take a few minutes for the resource to be fully deleted. -once a web app is deleted, it **cannot** be recovered. Therefore, ensure that you have backed up any important data before deleting the web app. [Deleted apps are purged from the system 30 days](https://learn.microsoft.com/en-us/troubleshoot/azure/app-service/create-delete-resources-faq) after initial deletion. Hope that helps -Grace