Azureポリシーを使用したサブスクリプションの一時停止の設定

  • リリースバージョン: Australia
  • 更新日 2026年03月12日
  • 所要時間:3分
  • Azureアカウントをロックまたはロック解除するポリシーをルートレベルで作成します。Azureアドミニストレーターは、Azureサブスクリプション、リソースグループ、またはリソースをロックして、誤って削除したり変更したりしないようにします。

    始める前に

    権限が既に設定されていることを確認してください。詳細については、「Azureでのアカウント一時停止の設定」を参照してください。

    必要なロール:Azure アドミン

    手順

    1. Azure組織にサインインします。
    2. [ユーザー] を検索して選択します。
    3. ユーザー名リストで、ユーザーを選択します。
    4. ナビゲーションペインから、[ アサインされたロール] を選択します。
    5. [管理] ロールで、[割り当ての追加] を選択してグローバル管理者ロールを追加します。
    6. 検索ボックスに Microsoft Entra ID と入力し、 Microsoft Entra ID > プロパティ.
    7. [Azure リソースのアクセス管理] で、切り替えを [はい] に設定します。
      このオプションを使用すると、このテナント内のすべての Azure サブスクリプションと管理グループへのアクセスを管理できます。
    8. [ポリシー] を検索して選択します。
    9. [+ ポリシー定義] を選択します。
    10. 次のように入力します。
      1. [定義の場所] の省略記号を使用してテナントルートグループを選択します。

        管理グループまたはサブスクリプションのいずれかを選択できます。テナントルートグループを選択した場合は、すべての子サブスクリプションも管理できます。

      2. ポリシー定義の名前を入力します。例:LockAccount_policy。
      3. ポリシー定義の目的の説明。
      4. [ポリシールール] で、次の JSON コードをコピーします。
        {
            "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. [Save (保存)] を選択します。
        注:
        ポリシーが作成されているかどうかを確認するには、[PolicyDefinitions] に移動します。フィルターの [スコープ] と [ポリシータイプ] を変更して、ポリシーを見つけます。
      6. ポリシー名を選択し、 定義 ID をコピーします。
      注:
      この定義 ID は、 アカウントの一時停止構成を作成するするときに必要です。

    次のタスク

    クラウドワークスペースでのクラウドアカウント管理の設定

    グループへのメンバーの追加

    Azure接続を設定

    データ可視化のためのスキャン構成の設定