Open yodobrin opened 2 years 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.
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:
@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:
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:
then you could use something else (or even azure policy maybe?) to delete things with specific tags in bulk?
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.
@dolevshor Any progress on easy cleanup automation ?
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.
Great @dolevshor Hope we will get the detailed steps on how to perform it.
Thank You…
@dolevshor the ARM action in workbooks allows for multiple operations as well, why not have that in the workbook?
a cool feature might be to clean up resource by type.