Set up suspension of a subscription using Azure policy

  • リリースバージョン: Australia
  • 更新日 2026年03月12日
  • 所要時間:5分
  • Create the policy at the root level to lock or unlock an Azure account. As an Azure administrator, lock an Azure subscription, resource group, or resource to avoid accidental deletions and modifications.

    始める前に

    Make sure you have already configured the permission. For more information, see Configure account suspension in Azure.

    Role required: Azure admin

    手順

    1. Sign in to the Azure organization.
    2. Search for and select Users.
    3. Under the user name list, select a user.
    4. From the navigation pane, select Assigned roles.
    5. Under the Administrative roles, add the Global Administrator role by selecting Add Assignments.
    6. Enter Microsoft Entra ID in the search box and select Microsoft Entra ID > Properties.
    7. Under Access Management for Azure resources, set the toggle to Yes.
      Using this option, you can manage access to all Azure subscriptions and management groups in this tenant.
    8. Search for and select Policy.
    9. Select + Policy definition.
    10. Enter the following:
      1. Select the tenant root group using the ellipsis on Definition location.

        You can select either a management group or a subscription. If you select the tenant root group, all child subscriptions can also be managed.

      2. Enter the name of the policy definition. For example, LockAccount_policy.
      3. The description of what the policy definition is intended to do.
      4. Under POLICY RULE, copy the following JSON code:
        {
            "properties": {
                "displayName": "CAM_LockAccount_Policy",
                "policyType": "Custom",
                "mode": "All",
                "description": "Blocks the creation of resources and configurations that fall under Azure Policy enforcement.",
                "parameters": {
                    "allowedResourceTypes": {
                        "type": "Array",
                        "metadata": {
                            "displayName": "Allowed Resource Types",
                            "description": "List of resource types that are allowed for creation. Any resource type not listed here will be blocked.",
                            "strongType": "resourceTypes"
                        },
                        "defaultValue": []
                    },
                    "allowedLocations": {
                        "type": "Array",
                        "metadata": {
                            "displayName": "Allowed Locations",
                            "description": "List of allowed Azure regions for resource creation."
                        },
                        "defaultValue": []
                    },
                    "effect": {
                        "type": "String",
                        "metadata": {
                            "displayName": "Effect",
                            "description": "The effect determines what happens when the policy rule is evaluated to match"
                        },
                        "allowedValues": [
                            "Audit",
                            "Deny",
                            "Disabled"
                        ],
                        "defaultValue": "Deny"
                    }
                },
                "policyRule": {
                    "if": {
                        "anyOf": [
                            {
                                "not": {
                                    "field": "type",
                                    "in": "[parameters('allowedResourceTypes')]"
                                }
                            },
                            {
                                "not": {
                                    "field": "location",
                                    "in": "[parameters('allowedLocations')]"
                                }
                            }
                        ]
                    },
                    "then": {
                        "effect": "[parameters('effect')]"
                    }
                }
            }
        }
      5. Select Save.
        注:
        To verify if the policy is created, go to PolicyDefinitions. Change the filter Scope and Policy type to find the policy.
      6. Select the policy name and copy the Definition ID.
      注:
      This Definition ID is required when you Create a suspend account configuration.

    次のタスク

    Setting up Cloud Account Management in Cloud Workspace

    Add members to the group

    Set up Azure connection

    Set up scan configuration for data visualization