title | description | ms.devlang | ms.topic | ms.date | ms.custom |
---|---|---|---|---|---|
Clean up Azure resources used in Python container tutorial |
How to clean up resources used in a tutorial showing how to containerize a Python web app (Django or Flask) and deploy it to App Service. |
python |
tutorial |
04/14/2025 |
devx-track-python |
In this part of the tutorial series, you learn how to clean up resources used in Azure so you don't incur other charges and help keep your Azure subscription uncluttered.
At the end of a tutorial or project, it's important to clean up any Azure resources you no longer need. This helps you:
- Avoid unnecessary charges – Resources left running can continue to accrue costs.
- Keep your Azure subscription organized – Removing unused resources makes it easier to manage and navigate your subscription.
In this tutorial, all the Azure resources were created in the same resource group. Removing the resource group removes all resources in the resource group and is the fastest way to remove all Azure resources used for your app.
Tip
If you plan to continue development or testing, you can leave the resources running. Just be aware of potential costs.
Azure CLI commands can be run in the Azure Cloud Shell or on a workstation with the Azure CLI installed.
Delete the resource group by using the az group delete command.
#!/bin/bash
RESOURCE_GROUP_NAME='msdocs-web-app-rg'
az group delete --name $RESOURCE_GROUP_NAME
# PowerShell syntax
$RESOURCE_GROUP_NAME='msdocs-web-app-rg'
az group delete --name $RESOURCE_GROUP_NAME
You can optionally add the --no-wait
argument to allow the command to return before the operation is complete.
To work with Azure resources in VS Code, you must have the Azure Tools extension pack installed and be signed into Azure from VS Code.
-
In the Azure view in VS Code (from the Azure Tools extension), expand RESOURCES and find your subscription.
-
Make sure the view is set to Group by Resource Group.
-
Locate the resource group you want to delete.
-
Right-click the resource group and select Delete Resource Group.
-
In the confirmation dialog, enter the exact name of the resource group.
-
Press ENTER to confirm and delete the resource group.
After completing this tutorial, here are some next steps you can take to build upon what you learned and move the tutorial code and deployment closer to production ready:
-
Deploy a web app from a geo-replicated Azure container registry
-
Map a custom DNS name to your app, see Tutorial: Map custom DNS name to your app.
-
Monitor App Service for availability, performance, and operation, see Monitoring App Service and Set up Azure Monitor for your Python application.
-
Enable continuous deployment to Azure App Service, see Continuous deployment to Azure App Service, Use CI/CD to deploy a Python web app to Azure App Service on Linux, and Design a CI/CD pipeline using Azure DevOps.
-
Create reusable infrastructure as code with Azure Developer CLI (azd).
The following are some Learn modules that explore the technologies and themes covered in this tutorial: