DEV Community

Cover image for Azure Management Task 6: Cleanup Resources
Peter Olanrewaju Fadeyi
Peter Olanrewaju Fadeyi

Posted on

Azure Management Task 6: Cleanup Resources

After completing the previous exercises, several Azure resources were created, including a virtual machine, virtual network, storage account, and other supporting services. To avoid unnecessary charges and keep the environment organized, it is important to properly clean up resources once they are no longer needed.

In this final task, you will remove resource locks and delete the resource group that contains all the resources created during the project. This demonstrates how Azure administrators safely decommission infrastructure while ensuring no protected resources block the deletion process.

STEPS
1. Remove delete locks

If you attempt to delete a resource that has a delete lock, Azure will prevent the operation and display a warning that the resource cannot be removed. To proceed with deletion, the lock must first be removed.

  • Login to Microsoft Azure at https://portal.azure.com

  • From the Azure portal home page, search for and select virtual machines.

vm

  • Select the virtual machine created earlier. Example:
guided-project-vm
Enter fullscreen mode Exit fullscreen mode
  • Expand the Settings submenu and select Locks.

  • Select Delete on the line for the VM-delete-lock and confirm **delete on the pop-up**

delete

Once the delete lock is removed, the virtual machine can now be deleted if needed.

If additional locks were created during the exercise, remove tem before continuing.

2. Delete the project resource group

One of the advantages of using Resource groups in Azure is the ability to delete multiple resources at once. When a resource group is deleted, all the resurces inside it are removed automatically.

  • From the Azure portal home page, search for and select resource groups.

rg

  • Select the Resource group create during the project.

Example:

guided-project-rg
Enter fullscreen mode Exit fullscreen mode

RG

  • Select Delete resource group.

  • Enter the resource group name to confirm deletion.

Resource group name: guided-project-rg
Enter fullscreen mode Exit fullscreen mode
  • Select Delete.

The Force delete option ensures that all resources created during the project are removed.

delete

  • Confirm the deletion when prompted.

delete

delete

3. Delete the NetworkWatcherRG(if necessary)

Azure automatically creates a resource group call NetworkWatcherRG when networking features such as Virtual Networks are used. This resource group contains diagnostic tools used for monitoring network activity.

  • From the Azure portal home page, search fr and select resource groups.

  • Select the resource group named:

NetworkWatcherRG
Enter fullscreen mode Exit fullscreen mode
  • Select Delete resource group.

  • Enter the resource group name in the confirmation box.

NetworkWatcherRG
Enter fullscreen mode Exit fullscreen mode
  • Select Delete and confirm the action.

watcher

network

If the NetworkWatcherRG resource group existed before the project began, you may choose to leave it in place.

Conclusion

In this final task, you completed the cleanup process by removing resource locks and deleting the resource group used during the project. This ensured that all deployed resources were safely removed from the Azure environment.

Cleaning up unused resources is an important administrative practice in cloud environments. It helps prevent unnecessary costs, maintains a well-organized infrastructure, and ensures that temporary lab resources do not remain active after they are no longer needed.

By completing this step, you have successfully finished the Azure Management Tasks project, gaining practical experience with resource deployment, configuration, storage management, tagging, resource locks, and environment cleanup in Microsoft Azure.

Top comments (0)