DEV Community

Cover image for Part 6: Resource Cleanup & Cost Control -Decommissioning Azure Infrastructure
     Faith Aneke Ada
Faith Aneke Ada

Posted on

Part 6: Resource Cleanup & Cost Control -Decommissioning Azure Infrastructure

Overview: 🧹 Clean Up (Avoid Unexpected Azure Costs)

Every good cloud engineer knows this:
If you don’t clean up, you keep paying and Azure resources continue running and billing until they are deleted.
So the final step in this guided project was to properly remove everything i have created.

This ensures:
•No unexpected charges
•No orphaned resources
•A clean environment

Procedure

🔓 Step 1: Remove Delete Locks

Earlier in the project,i protected the VM with a Delete lock.
Hence, before deleting anything that lock must be removed.
Here’s what i did:

✔ Removing the VM Lock

1.Navigated to Virtual Machines
2.Selected guided-project-vm
3.Opened Settings → Locks
4.Deleted the VM-delete-lock
5.Confirmed removal
delete lock

Once the lock was removed,the VM became eligible for deletion.

✔ Removing the Resource Group Lock (If Applied)

Since i also applied a lock at the Resource Group level, i :
1.Navigated to Resource Groups
2.Selected the project resource group

3.Opened Settings → Locks
4.Deleted the Resource Group delete lock

Rg lock

5.Confirmed removal.

💡 Reminder

Always remove locks before attempting to delete resources.

🗑️ Step 2: Delete the Resource Group

One of the biggest advantages of using resource groups is that you can delete everything at once.
Where instead of deleting:
•The VM
•The VNet
•The Storage account
•The NSG
•The Subnets individually…

I simply:
1.Navigated to Resource Groups
2.Selected guided-project-rg
project-rg

3.Chose Delete resource group
Delete rg

4.Entered the resource group name to confirm.
5.Confirmed removal
enter rg name

Within a few minutes, Azure removed all associated resources.
Clean. Efficient. Complete.

⚠️ Important Note: The NetworkWatcherRG Check

🔗 Azure sometimes automatically creates a resource group called ¥NetworkWatcherRG,if it already existed before the project, do NOT delete it.
🔗 If it was created during this guided project, then it should also be removed using the same deletion process.
🔗 Always verify before deleting shared system resource groups.

✅ Final Outcome’

At this point:
☑️ •All locks removed
☑️ •All project resources deleted
☑️ •No active billable services remaining
☑️ •Environment fully cleaned

This concludes the Azure Management Tasks Guided Project.

From:

✔ Environment setup
✔ Networking updates
✔ VM management
✔ Storage configuration
✔ Tags & governance
✔ Cleanup & cost control

This is a full administrative lifecycle, end to end.

Top comments (0)