How can I delete 2 x custom initiative definitions from subscription

Mark Bavington 60 Reputation points
2023-06-16T13:23:31.77+00:00

Hi

I recently deployed an enterprise scale landing zone configuration with a hub and spoke architecture.

I wanted to clean up the deployment and start again so I deleted all resource and assignments but was left with a large amount of "Custom" Initiative Definitions, which I was able to remove manually with the exception of two.

I cannot work out how to delete these last 2 x initiative definitions and was hoping someone could assist me as I have tried manually and via some PS scripts that look like it works but they still remain visible, see below:

User's image

Please could I have some suggestions as to the best way to remove these definitions as I'm losing the will to live and would prefer to retain all my subscriptions rather than recreating to get rid of the troublesome definitions?

Many thanks

Mark

Azure Policy
Azure Policy
An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
1,019 questions
0 comments No comments
{count} votes

Accepted answer
  1. Richard Redgrave 900 Reputation points Microsoft Employee
    2023-06-19T09:30:56.51+00:00

    Hello Mark,

    I have replicated the same issue as yourself. You will need to delete the Azure Policy assignment first, before you can delete the initiatives. An Azure Policy initiative can contain one or more Policies.

    • Go into the Azure Policy dashboard
    • Go to 'Assignments'
    • Change the scope where the initiatives are assigned e.g "Decommissioned" or "Sandbox".
    • You should now see the Azure Policy initiative (e.g Enforce ALZ Sandbox Guardrails)
    • Click the three dots on the right and "Delete assignment"

    This should now delete the assignment, note this can take up to 30 minutes take effect.

    Now go into the Policy Definitions and you will be able to delete the policy initiatives by locating the initiative, click the three dots on the far right and then "delete definition"

    I hope this helps you, please let us know if this helped

    Thanks

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Mark Bavington 60 Reputation points
    2023-06-19T12:47:54.9033333+00:00

    Hi Richard

    Thank you for the advise.

    Looks like it worked like a charm, will need to wait to see for sure but so far so good.

    Many thanks

    Mark

    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.