dolevshor / azure-orphan-resources

Centralize orphan resources in Azure environments
MIT License
533 stars 141 forks source link

Enable easy cleanup #1

Open yodobrin opened 2 years ago

yodobrin commented 2 years ago

a cool feature might be to clean up resource by type.

azurekid commented 1 year ago

So what we could do is add the PowerShell command to the workbook to clean-up the resources. Doing this automated can be a risk and requires extra permissions.

Another option could be to add a FunctionApp and feed it the query from the workbook to clean the orphaned resources. The managed Identity of this function app could be used for authentication to the subscription.

francesco1119 commented 7 months ago

Removing with a click is to risky. But maybe we can have the PowerShell code for deleting that resource generated automatically. This way people might want to:

gardnerjr commented 5 months ago

@dolevshor workbooks supports an action in links/action steps called "ARM Action", which shows a confirmation prompt, and the author of the worbook controls what shows up in the confirmation as markdown/etc.

here's an example i have locally in the workbooks test cases:

image

gardnerjr commented 5 months ago

another option would be: instead of actually DELETING the resources in workbooks, you could have ARM Action that adds specific tag(s) to the resources? like adding a tag to all the resources:

image

then you could use something else (or even azure policy maybe?) to delete things with specific tags in bulk?

dolevshor commented 5 months ago

Hi @gardnerjr,

Thanks a lot for the suggestions. It is definitely a very useful addition to the workbook and it joins to the backlog.

The goal at the end is not just to recognize the orphaned resources, it's to remove those resources safely.

Anto4595 commented 1 week ago

@dolevshor Any progress on easy cleanup automation ?

dolevshor commented 1 week ago

Hi @Anto4595 ,

Yes, this is ready and will be released early next week. It will enable the deletion of a single resource through the workbook or multiple resources via the CLI.

Anto4595 commented 1 week ago

Great @dolevshor Hope we will get the detailed steps on how to perform it.

Thank You…

gardnerjr commented 5 days ago

@dolevshor the ARM action in workbooks allows for multiple operations as well, why not have that in the workbook?