Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alias request: "Microsoft.Subscription/SubscriptionDefinitions/state" #1407

Open
AnkitPathak41 opened this issue Dec 5, 2024 · 0 comments
Open

Comments

@AnkitPathak41
Copy link

AnkitPathak41 commented Dec 5, 2024

Scenario

Need to use Azure Policy to deny changing the state of disabled subscription under decommissioned management group to maintain the state of subscriptions following the CAF model.

Definition

{
  "properties": {
    "displayName": "Deny Enabling Disabled Subscriptions",
    "description": "Ensures that subscriptions in a disabled state remain disabled and cannot be reactivated.",
    "metadata": {
  
      "category": "Subscriptions"
    },
    "policyRule": {
      "if": {
        "allOf": [
          {
            "field": "Microsoft.Subscription/SubscriptionDefinitions/state",
            "equals": "Enabled"
          },
          {
            "field": "Microsoft.Subscription/SubscriptionDefinitions/state",
            "notEquals": "Disabled"
          }
        ]
      },
      "then": {
        "effect": "Deny"
      }
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant