ARM テンプレートを使用したサービスと SIM ポリシーの構成

"サービス" および "SIM ポリシー" は、Azure Private 5G Core のカスタマイズ可能なポリシー制御の重要なコンポーネントです。これにより、トラフィックの処理を柔軟に行うことができます。 パケット コア インスタンスがサービス データ フロー (SDF) にサービスの品質 (QoS) 特性を適用する方法を正確に決めることで、デプロイのニーズに対応することができます。 詳細については、「ポリシー コントロール」を参照してください。 このハウツー ガイドでは、Azure Resource Manager テンプレート (ARM テンプレート) を使用して簡単なサービスと SIM ポリシーを作成する方法について説明します。

Azure Resource Manager テンプレートは JavaScript Object Notation (JSON) ファイルであり、プロジェクトのインフラストラクチャと構成が定義されています。 このテンプレートでは、宣言型の構文が使用されています。 デプロイしようとしているものを、デプロイを作成する一連のプログラミング コマンドを記述しなくても記述できます。

環境が前提条件を満たしていて、ARM テンプレートの使用に慣れている場合は、 [Azure へのデプロイ] ボタンを選択します。 Azure portal でテンプレートが開きます。

Button to deploy the Resource Manager template to Azure.

前提条件

  • プライベート モバイル ネットワークの作成に使用したアクティブなサブスクリプションへのアクセス権を持つアカウントを使用して、Azure portal にサインインできることを確認します。 このアカウントには、サブスクリプション スコープでの組み込み共同作成者または所有者ロールが必要です。

  • プライベート モバイル ネットワークとそれを含むリソース グループに対応するモバイル ネットワーク リソースの名前を識別します。

  • プライベート モバイル ネットワークをデプロイした Azure リージョンを特定します。

  • SIM ポリシーを割り当てるネットワーク スライスの名前を識別します。

  • 新しいポリシーを割り当てるデータ ネットワークの名前を識別します。

  • ARM テンプレートに、双方向のすべてのトラフィックを許可する、既定のサービスと SIM ポリシーを構成する値を設定します。

    別の目的のためにサービスと SIM ポリシーを作成する場合は、「サービスに必要な情報を収集する」と「SIM ポリシーに必要な情報を収集する」の情報を使用し、要件を満たすようにサービスと SIM ポリシーを設計します。 これらの新しい値は ARM テンプレートのデプロイの一環として入力します。

テンプレートを確認する

このハウツー ガイドで使用されているテンプレートは Azure クイックスタート テンプレートのものです。

{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "metadata": {
    "_generator": {
      "name": "bicep",
      "version": "0.22.6.54827",
      "templateHash": "7793736700363560682"
    }
  },
  "parameters": {
    "location": {
      "type": "string",
      "metadata": {
        "description": "Region where the Mobile Network will be deployed (must match the resource group region)"
      }
    },
    "existingMobileNetworkName": {
      "type": "string",
      "metadata": {
        "description": "Name of the Mobile Network to add a SIM policy to"
      }
    },
    "existingSliceName": {
      "type": "string",
      "metadata": {
        "description": "Name of the existing slice to use for the SIM policy"
      }
    },
    "existingDataNetworkName": {
      "type": "string",
      "metadata": {
        "description": "Name of the existing data network to use for the SIM policy"
      }
    },
    "serviceName": {
      "type": "string",
      "defaultValue": "Allow_all_traffic",
      "metadata": {
        "description": "The name of the service"
      }
    },
    "serviceMaximumBitRateUplink": {
      "type": "string",
      "defaultValue": "2 Gbps",
      "metadata": {
        "description": "The maximum bit rate (MBR) for uploads across all service data flows that match data flow policy rules configured on the generic service"
      }
    },
    "serviceMaximumBitRateDownlink": {
      "type": "string",
      "defaultValue": "2 Gbps",
      "metadata": {
        "description": "The maximum bit rate (MBR) for downloads across all service data flows that match data flow policy rules configured on the generic service"
      }
    },
    "servicePrecedence": {
      "type": "int",
      "defaultValue": 253,
      "minValue": 0,
      "maxValue": 255,
      "metadata": {
        "description": "The precedence value for the service being deployed."
      }
    },
    "dataFlowPolicyRuleName": {
      "type": "string",
      "defaultValue": "All_traffic",
      "metadata": {
        "description": "The name of the data flow policy rule that will be created for this service."
      }
    },
    "dataFlowPolicyRulePrecedence": {
      "type": "int",
      "defaultValue": 253,
      "minValue": 0,
      "maxValue": 255,
      "metadata": {
        "description": "The precedence value for the data flow policy rule being created."
      }
    },
    "dataFlowPolicyRuleTrafficControl": {
      "type": "string",
      "defaultValue": "Enabled",
      "allowedValues": [
        "Enabled",
        "Blocked"
      ],
      "metadata": {
        "description": "Whether flows matching this data flow policy rule are permitted or blocked."
      }
    },
    "dataFlowTemplateProtocols": {
      "type": "array",
      "defaultValue": [
        "ip"
      ],
      "metadata": {
        "description": "Which protocols match this data flow policy rule. This should be either a list of IANA protocol numbers or the special value \"ip\""
      }
    },
    "dataFlowTemplateName": {
      "type": "string",
      "defaultValue": "ip_traffic",
      "metadata": {
        "description": "The name of the data flow template that will be created for this service."
      }
    },
    "dataFlowTemplateDirection": {
      "type": "string",
      "defaultValue": "Bidirectional",
      "allowedValues": [
        "Uplink",
        "Downlink",
        "Bidirectional"
      ],
      "metadata": {
        "description": "The direction of the flow to match with this data flow policy rule."
      }
    },
    "dataFlowTemplateRemoteIps": {
      "type": "array",
      "defaultValue": [
        "any"
      ],
      "metadata": {
        "description": "The remote IP addresses that UEs will connect to for this flow. This should be either a list of IP addresses or the special value \"any\""
      }
    },
    "simPolicyName": {
      "type": "string",
      "defaultValue": "Default-policy",
      "metadata": {
        "description": "The name of the SIM policy"
      }
    },
    "totalBandwidthAllowedUplink": {
      "type": "string",
      "defaultValue": "2 Gbps",
      "metadata": {
        "description": "The UE aggregated maximum bit rate (UE-AMBR) for uploads across all non-GBR QoS flows for a particular UE"
      }
    },
    "totalBandwidthAllowedDownlink": {
      "type": "string",
      "defaultValue": "2 Gbps",
      "metadata": {
        "description": "The UE aggregated maximum bit rate (UE-AMBR) for downloads across all non-GBR QoS flows for a particular UE"
      }
    },
    "sessionAggregateMaximumBitRateUplink": {
      "type": "string",
      "defaultValue": "2 Gbps",
      "metadata": {
        "description": "The session aggregated maximum bit rate (Session-AMBR) for uploads across all non-GBR QoS flows of an individual PDU session involving a particular UE"
      }
    },
    "sessionAggregateMaximumBitRateDownlink": {
      "type": "string",
      "defaultValue": "2 Gbps",
      "metadata": {
        "description": "The session aggregated maximum bit rate (Session-AMBR) for downloads across all non-GBR QoS flows of an individual PDU session involving a particular UE"
      }
    }
  },
  "resources": [
    {
      "type": "Microsoft.MobileNetwork/mobileNetworks/services",
      "apiVersion": "2023-09-01",
      "name": "[format('{0}/{1}', parameters('existingMobileNetworkName'), parameters('serviceName'))]",
      "location": "[parameters('location')]",
      "properties": {
        "servicePrecedence": "[parameters('servicePrecedence')]",
        "serviceQosPolicy": {
          "maximumBitRate": {
            "uplink": "[parameters('serviceMaximumBitRateUplink')]",
            "downlink": "[parameters('serviceMaximumBitRateDownlink')]"
          }
        },
        "pccRules": [
          {
            "ruleName": "[parameters('dataFlowPolicyRuleName')]",
            "rulePrecedence": "[parameters('dataFlowPolicyRulePrecedence')]",
            "trafficControl": "[parameters('dataFlowPolicyRuleTrafficControl')]",
            "serviceDataFlowTemplates": [
              {
                "templateName": "[parameters('dataFlowTemplateName')]",
                "protocol": "[parameters('dataFlowTemplateProtocols')]",
                "direction": "[parameters('dataFlowTemplateDirection')]",
                "remoteIpList": "[parameters('dataFlowTemplateRemoteIps')]"
              }
            ]
          }
        ]
      }
    },
    {
      "type": "Microsoft.MobileNetwork/mobileNetworks/simPolicies",
      "apiVersion": "2023-09-01",
      "name": "[format('{0}/{1}', parameters('existingMobileNetworkName'), parameters('simPolicyName'))]",
      "location": "[parameters('location')]",
      "properties": {
        "ueAmbr": {
          "uplink": "[parameters('totalBandwidthAllowedUplink')]",
          "downlink": "[parameters('totalBandwidthAllowedDownlink')]"
        },
        "defaultSlice": {
          "id": "[resourceId('Microsoft.MobileNetwork/mobileNetworks/slices', parameters('existingMobileNetworkName'), parameters('existingSliceName'))]"
        },
        "sliceConfigurations": [
          {
            "slice": {
              "id": "[resourceId('Microsoft.MobileNetwork/mobileNetworks/slices', parameters('existingMobileNetworkName'), parameters('existingSliceName'))]"
            },
            "defaultDataNetwork": {
              "id": "[resourceId('Microsoft.MobileNetwork/mobileNetworks/dataNetworks', parameters('existingMobileNetworkName'), parameters('existingDataNetworkName'))]"
            },
            "dataNetworkConfigurations": [
              {
                "dataNetwork": {
                  "id": "[resourceId('Microsoft.MobileNetwork/mobileNetworks/dataNetworks', parameters('existingMobileNetworkName'), parameters('existingDataNetworkName'))]"
                },
                "sessionAmbr": {
                  "uplink": "[parameters('sessionAggregateMaximumBitRateUplink')]",
                  "downlink": "[parameters('sessionAggregateMaximumBitRateDownlink')]"
                },
                "allowedServices": [
                  {
                    "id": "[resourceId('Microsoft.MobileNetwork/mobileNetworks/services', parameters('existingMobileNetworkName'), parameters('serviceName'))]"
                  }
                ]
              }
            ]
          }
        ]
      },
      "dependsOn": [
        "[resourceId('Microsoft.MobileNetwork/mobileNetworks/services', parameters('existingMobileNetworkName'), parameters('serviceName'))]"
      ]
    }
  ]
}

テンプレートでは、次の 2 つの Azure リソースが定義されています。

テンプレートのデプロイ

  1. Azure にサインインして、テンプレートを開くには、次のリンクを選択します。

    Button to deploy the Resource Manager template to Azure.

  2. 前提条件」で取得した情報を使用して、次の値を選択または入力します。

    • [サブスクリプション]: プライベート モバイル ネットワークの作成に必要な Azure サブスクリプションを選択します。
    • [リソース グループ]: プライベート モバイル ネットワークを表すモバイル ネットワーク リソースを含むリソース グループを選択します。
    • リージョン: プライベート モバイル ネットワークをデプロイしたリージョンを選択します。
    • 場所: プライベート モバイル ネットワークをデプロイしたリージョンのコード名を入力します。
    • [Existing Mobile Network Name]\(既存のモバイル ネットワーク名\): プライベート モバイル ネットワークを表すモバイル ネットワーク リソースの名前を入力します。
    • 既存のスライス名: ネットワーク スライスを表すスライス リソースの名前を入力します。
    • 既存のデータ ネットワーク名: データ ネットワークの名前を入力します。 この値は、データ ネットワークを作成するときに使用した名前に一致している必要があります。
  3. 既定のサービスと SIM ポリシーを使用する場合、その他のフィールドは変更しません。 それ以外の場合は、構成するサービスと SIM ポリシーに合うように、「サービスに必要な情報を収集する」と「SIM ポリシーに必要な情報を収集する」で収集した情報を使用してその他のフィールドに入力します。

  4. [Review + create](レビュー + 作成) を選択します。

  5. これで、入力した構成値が Azure によって検証されます。 値が検証に合格したことを示すメッセージが表示されます。

    検証に失敗した場合、エラー メッセージが表示され、無効な構成が含まれる [構成] タブにフラグが付きます。 [確認と作成] タブに戻る前に、フラグが付加されたタブを選択し、エラー メッセージを使用して無効な構成を修正してください。

  6. 構成が検証されたら、[作成] を選択してサービスと SIM ポリシーを作成できます。 デプロイが完了すると、Azure portal に確認画面が表示されます。

デプロイされているリソースを確認する

  1. 確認画面で、[リソース グループに移動] を選択します。

    Screenshot of the Azure portal showing a deployment confirmation for the ARM template.

  2. サービスと SIM ポリシーがリソース グループに作成されていることを確認します。

    Screenshot of the Azure portal showing a resource group containing newly provisioned SIMs.

次のステップ

これで、SIM ポリシーを SIM に割り当ててサービスに取り込むことができます。