Can't restrict Subscription creation with Azure Policy.

Swapnil Jambhulkar 0 Reputation points
2024-10-19T16:17:03.6566667+00:00

We created the policy that should restrict the creation of new subscription, if it has any or all of the specific tags missing.

The policy is not restricting the creation of new subscription but, is marking the subscription "non-compliant" after it has been created, if any given tag is missing.

The Policy rule is like below:

"policyRule": {

  "if": {

    "allOf": [

      {

        "equals": "Microsoft.Resources/subscriptions",

        "field": "type"

      },

      {

        "anyOf": [

          {

            "exists": "false",

            "field": "tags['ProjectName']"

          },

          {

            "exists": "false",

            "field": "tags['Environment']"

          }

        ]

      }

    ]

  },

  "then": {

    "effect": "Deny"

  }

}  

Is is possible to restrict subscription creation using Azure Policy?

Azure Policy
Azure Policy
An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
927 questions
{count} votes

2 answers

Sort by: Most helpful
  1. akinbade abiola 19,210 Reputation points
    2024-10-19T23:30:35.76+00:00

    There is no control in Entra to disable subscription signups (other than license-based subscriptions). There is an internal process for blocking non EA subscriptions through a support ticket and we can only block non-EA offer sign-ups.

    This is referenced from: https://learn.microsoft.com/en-us/answers/questions/701756/prevent-standard-users-from-creating-subscriptions

    You can mark it 'Accept Answer' and 'Upvote' if this helped you

    Regards,

    Abiola

    0 comments No comments

  2. Rohit Rai 1 Reputation point
    2024-11-20T16:18:10.97+00:00

    I'm trying similar thing but not able to enforce deny subscription creation, only after creation it show up as non-compliant

    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.