DEV Community

Cover image for # 🧹 Azure Management Series — Cleaning Up Resources Safely in Azure
 Ganiyat Olagoke Adebayo
Ganiyat Olagoke Adebayo

Posted on

# 🧹 Azure Management Series — Cleaning Up Resources Safely in Azure

When working in Azure—especially during guided projects, labs, or training—it's easy to accumulate resources that continue running in the background. Virtual machines, disks, storage accounts, and networking components can quietly incur charges even when you're no longer using them.

That’s why cleanup is the final and most critical step. In this post, you’ll walk through the Azure cleanup process for the guided project environment—removing locks, deleting the resource group, and ensuring no leftover infrastructure continues to generate costs.

Let’s dive in! šŸ‘‡


Why Cleanup Matters

Azure resources cost money as long as they exist—even if they’re not running.

Proper cleanup helps you:

  • Avoid surprise charges
  • Keep your Azure environment tidy and manageable
  • Ensure you start fresh for future labs or projects
  • Follow best practices for real-world cloud resource lifecycle management

Once you're done with a lab or temporary environment, deleting the resource group is the fastest and cleanest way to remove everything at once.
But first—you must clear any delete locks.


Exercise — Clean Up Azure Resources

Below is the step-by-step process to safely remove all resources created during the guided project.


1. Remove Delete Locks

Delete locks prevent accidental deletion—but they also prevent the resource group from being removed. So you must remove them first.

Steps:

  1. Log in to Azure Portal → https://portal.azure.com
  2. In the search bar, type Virtual machines
  3. Select guided-project-vm
  4. Under Settings, choose Locks
  5. Locate VM-delete-lock, then click Delete
  6. Confirm deletion in the pop-up

If you created additional delete locks during previous exercises, remove those as well.

The VM is now ready to be deleted.


2. Delete the Project Resource Group

This is the quickest way to delete all resources created for the guided project.

Steps:

  1. In the portal search bar, type Resource groups
  2. Select guided-project-rg
  3. Click Delete resource group
  4. Check Apply force delete…
  5. Type guided-project-rg to confirm
  6. Select Delete
  7. Confirm once more in the pop-up

The deletion may take about 5 minutes.
Refresh the page until the group disappears.


Important Reminder: NetworkWatcherRG

Azure sometimes creates a NetworkWatcherRG resource group automatically.

You must check whether it already existed before the project:

  • If it existed originally → DO NOT delete it
  • If Azure created it during this project → you MUST delete it

To delete it (only if required):

  1. Open Resource groups
  2. Select NetworkWatcherRG
  3. Choose Delete resource group
  4. Confirm with the name
  5. Delete


Again, it may take around 5 minutes.


Final Thoughts — And What’s Next

Congratulations! You’ve completed the final step of the guided Azure Management Project: performing a proper cleanup.

This brings your entire project cycle full-circle:

  • You prepared the environment
  • Created networks and subnets
  • Deployed and managed virtual machines
  • Controlled storage access
  • Applied tags and locks
  • And now… safely removed all resources

You're now ready for the cloud adventure, where you’ll expand into more advanced Azure responsibilities and continue developing real-world cloud management skills.


Top comments (0)