how to delete webspace

chaowen guo 16 Reputation points
2021-11-06T15:48:21.023+00:00

az group delete -n app0 -y --debug
az group create -n app0 -l westus --debug
az appservice plan create -n app0 -g app0 --sku F1 --is-linux --debug
az webapp create -n app0ap -p app0 -g app0 -i nginx --debug
az webapp config appsettings set -n app0ap -g app0 --settings PORT=80 --debug

I use the above command to delete and create web app, but in the third step I get
{'Code': 'Conflict', 'Message': 'App Service Plan(s) Default1rx in Webspace app0-WestUSwebspace contain resources. Please delete them first.', 'Target': None, 'Details': [{'Message': 'App Service Plan(s) Default1rx in Webspace app0-WestUSwebspace contain resources. Please delete them first.'}, {'Code': 'Conflict'}, {'ErrorEntity': {'ExtendedCode': '03006', 'MessageTemplate': 'App Service Plan(s) {0} in Webspace {1} contain resources. Please delete them first.', 'Parameters': ['Default1rx', 'app0-WestUSwebspace'], 'Code': 'Conflict', 'Message': 'App Service Plan(s) Default1rx in Webspace app0-WestUSwebspace contain resources. Please delete them first.'}}], 'Innererror': None}

App Service Plan(s) Default1rx in Webspace app0-WestUSwebspace contain resources. Please delete them first

I want to know how to delete them. I want to do it using azure cli or azure rest api

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
850 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 20,856 Reputation points
    2021-11-09T07:00:26.15+00:00

    Thanks for asking question! You may want to know that Azure deploys each new App Service plan into a deployment unit, internally called a webspace.

    Could you please double check if the resource group you created in 2nd step az group create -n app0 -l westus –debug is in Free Sku or other?

    Refer here for parameters of az group delete

    For deleting App service plan you can use az appservice plan delete

    Also note that It is not possible to delete an AppService plan when it is associated with a WebApp and if you want to delete both the webapp and appservice plan together you can use webapp delete command.

    Let us know.

    0 comments No comments