Disable/Clean-up Resources in Azure

David 41 Reputation points
2022-03-30T21:43:45.263+00:00

I am trying to clean up a subscription which I believe contains many resources that have been abandoned by former (and possibly current) employees.
In amongst the muck is some gold, which I do not want to incorrectly delete.

What I'd like to do is prevent those resources from running or being accessed in any way to see who screams.

Is there a way to do this?
I was thinking about trying to create a new PAYG subscription with zero dollars in it an moving the resource groups there - is that even possible?
I feel like there must be a known approach to this problem, I cannot be the first person to want to do this.

Azure Cost Management
Azure Cost Management
A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.
3,578 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. SadiqhAhmed-MSFT 49,326 Reputation points Microsoft Employee Moderator
    2022-03-31T09:21:07.14+00:00

    Hello @David Thank you for reaching out to us. Happy to answer your questions.

    From the details provided in the original post, it seems you are planning to clean up unused resources and also wanting to prevent users access to those users and stop billing for the same.

    Please find the answers to your specific questions:

    I was thinking about trying to create a new PAYG subscription with zero dollars in it an moving the resource groups there - is that even possible?
    YES, it is possible to move resources from one subscription to another. Here is the guide you can refer to - https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/move-resource-group-and-subscription

    One more approach is to continue using the same subscription and find unused/orphaned resources and delete them. As far as preventing access to users, you can assign role based access control - https://learn.microsoft.com/en-us/azure/role-based-access-control/overview

    Azure Resource Graph is very adept at finding unused/orphaned resources. See the examples for finding orphaned resources on github AzureResourceGraph-Examples/OrphanedResource.MD at master · scautomation/AzureResourceGraph-Examples · GitHub, that are also incorporated in Workbook GitHub - scautomation/Azure-Inventory-Workbook: The Ultimate Azure Inventory Dashboard

    The examples also take into account some of the issues where disks and NICs can be used for VMs but also for other things like Backup or private endpoints.

    Resource graph can be queried via PowerShell as well for scripted scenarios. Quickstart: Your first PowerShell query - Azure Resource Graph | Microsoft Learn

    ----------------------------------------------------------------------------------------------------------------------

    If the response helped, do "Accept Answer" and up-vote it

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.