使用ARM範本建立網站

Azure Private 5G Core 私人行動網路包含一或多個 網站。 每個網站都代表實體企業位置(例如 Contoso Corporation 的芝加哥工廠),其中包含裝載封包核心實例的 Azure Stack Edge 裝置。 在本操作指南中,您將瞭解如何使用 Azure Resource Manager 範本(ARM 範本)在私人行動網路中建立網站。

Azure Resource Manager 範本是 JavaScript 物件表示法 (JSON) 檔案,可定義專案的基礎結構和組態。 範本使用宣告式語法。 您不需要撰寫程式設計命令順序來建立部署,即可描述預定的部署。

如果您的環境符合必要條件,而且您很熟悉 ARM 範本,請選取 [部署至 Azure] 按鈕。 範本會在 Azure 入口網站中開啟。

Button to deploy the Resource Manager template to Azure.

必要條件

  • 識別 Azure Stack Edge Pro 裝置上對應至埠 5 和 6 的介面名稱。
  • 識別 Azure Stack Edge Pro 裝置上對應至埠 3 和 4 的介面名稱。

檢閱範本

本操作指南中使用的範本來自 Azure 快速入門範本

{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "metadata": {
    "_generator": {
      "name": "bicep",
      "version": "0.23.1.45101",
      "templateHash": "13737379177024397484"
    }
  },
  "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 which you are adding a site"
      }
    },
    "existingDataNetworkName": {
      "type": "string",
      "metadata": {
        "description": "Name of the existing data network to which the mobile network connects"
      }
    },
    "siteName": {
      "type": "string",
      "defaultValue": "myExampleSite",
      "metadata": {
        "description": "The name for the site"
      }
    },
    "azureStackEdgeDevice": {
      "type": "string",
      "defaultValue": "",
      "metadata": {
        "description": "The resource ID of the Azure Stack Edge device to deploy to"
      }
    },
    "controlPlaneAccessInterfaceName": {
      "type": "string",
      "defaultValue": "",
      "metadata": {
        "description": "The virtual network name on port 5 on your Azure Stack Edge Pro device corresponding to the control plane interface on the access network. For 5G, this interface is the N2 interface; for 4G, it's the S1-MME interface."
      }
    },
    "controlPlaneAccessIpAddress": {
      "type": "string",
      "defaultValue": "",
      "metadata": {
        "description": "The IP address of the control plane interface on the access network. In 5G networks this is called the N2 interface whereas in 4G networks this is called the S1-MME interface."
      }
    },
    "userPlaneAccessInterfaceName": {
      "type": "string",
      "defaultValue": "",
      "metadata": {
        "description": "The virtual network name on port 5 on your Azure Stack Edge Pro device corresponding to the user plane interface on the access network. For 5G, this interface is the N3 interface; for 4G, it's the S1-U interface."
      }
    },
    "userPlaneDataInterfaceName": {
      "type": "string",
      "defaultValue": "",
      "metadata": {
        "description": "The virtual network name on port 6 on your Azure Stack Edge Pro device corresponding to the user plane interface on the data network. For 5G, this interface is the N6 interface; for 4G, it's the SGi interface."
      }
    },
    "userEquipmentAddressPoolPrefix": {
      "type": "string",
      "defaultValue": "",
      "metadata": {
        "description": "The network address of the subnet from which dynamic IP addresses must be allocated to UEs, given in CIDR notation. Optional if userEquipmentStaticAddressPoolPrefix is specified. If both are specified, they must be the same size and not overlap."
      }
    },
    "userEquipmentStaticAddressPoolPrefix": {
      "type": "string",
      "defaultValue": "",
      "metadata": {
        "description": "The network address of the subnet from which static IP addresses must be allocated to UEs, given in CIDR notation. Optional if userEquipmentAddressPoolPrefix is specified. If both are specified, they must be the same size and not overlap."
      }
    },
    "coreNetworkTechnology": {
      "type": "string",
      "defaultValue": "5GC",
      "allowedValues": [
        "EPC",
        "5GC",
        "EPC + 5GC"
      ],
      "metadata": {
        "description": "The mode in which the packet core instance will run"
      }
    },
    "naptEnabled": {
      "type": "string",
      "allowedValues": [
        "Enabled",
        "Disabled"
      ],
      "metadata": {
        "description": "Whether or not Network Address and Port Translation (NAPT) should be enabled for this data network"
      }
    },
    "dnsAddresses": {
      "type": "array",
      "metadata": {
        "description": "A list of DNS servers that UEs on this data network will use"
      }
    },
    "customLocation": {
      "type": "string",
      "defaultValue": "",
      "metadata": {
        "description": "The resource ID of the custom location that targets the Azure Kubernetes Service on Azure Stack HCI (AKS-HCI) cluster on the Azure Stack Edge Pro device in the site. If this parameter is not specified, the packet core instance will be created but will not be deployed to an ASE. [Collect custom location information](https://docs.microsoft.com/en-gb/azure/private-5g-core/collect-required-information-for-a-site#collect-custom-location-information) explains which value to specify here."
      }
    },
    "desiredState": {
      "type": "string",
      "defaultValue": "Uninstalled",
      "metadata": {
        "description": "The desired installation state"
      }
    },
    "ueMtu": {
      "type": "int",
      "defaultValue": 1440,
      "metadata": {
        "description": "The MTU (in bytes) signaled to the UE. The same MTU is set on the user plane data links for all data networks. The MTU set on the user plane access link is calculated to be 60 bytes greater than this value to allow for GTP encapsulation. "
      }
    }
  },
  "resources": [
    {
      "type": "Microsoft.MobileNetwork/packetCoreControlPlanes/packetCoreDataPlanes/attachedDataNetworks",
      "apiVersion": "2023-09-01",
      "name": "[format('{0}/{1}/{2}', parameters('siteName'), parameters('siteName'), parameters('existingDataNetworkName'))]",
      "location": "[parameters('location')]",
      "properties": {
        "userPlaneDataInterface": {
          "name": "[parameters('userPlaneDataInterfaceName')]"
        },
        "userEquipmentAddressPoolPrefix": "[if(empty(parameters('userEquipmentAddressPoolPrefix')), null(), createArray(parameters('userEquipmentAddressPoolPrefix')))]",
        "userEquipmentStaticAddressPoolPrefix": "[if(empty(parameters('userEquipmentStaticAddressPoolPrefix')), null(), createArray(parameters('userEquipmentStaticAddressPoolPrefix')))]",
        "naptConfiguration": {
          "enabled": "[parameters('naptEnabled')]"
        },
        "dnsAddresses": "[parameters('dnsAddresses')]"
      },
      "dependsOn": [
        "[resourceId('Microsoft.MobileNetwork/packetCoreControlPlanes/packetCoreDataPlanes', parameters('siteName'), parameters('siteName'))]"
      ]
    },
    {
      "type": "Microsoft.MobileNetwork/packetCoreControlPlanes/packetCoreDataPlanes",
      "apiVersion": "2023-09-01",
      "name": "[format('{0}/{1}', parameters('siteName'), parameters('siteName'))]",
      "location": "[parameters('location')]",
      "properties": {
        "userPlaneAccessInterface": {
          "name": "[parameters('userPlaneAccessInterfaceName')]"
        }
      },
      "dependsOn": [
        "[resourceId('Microsoft.MobileNetwork/packetCoreControlPlanes', parameters('siteName'))]"
      ]
    },
    {
      "type": "Microsoft.MobileNetwork/mobileNetworks/sites",
      "apiVersion": "2023-09-01",
      "name": "[format('{0}/{1}', parameters('existingMobileNetworkName'), parameters('siteName'))]",
      "location": "[parameters('location')]"
    },
    {
      "type": "Microsoft.MobileNetwork/packetCoreControlPlanes",
      "apiVersion": "2023-09-01",
      "name": "[parameters('siteName')]",
      "location": "[parameters('location')]",
      "properties": {
        "sites": [
          {
            "id": "[resourceId('Microsoft.MobileNetwork/mobileNetworks/sites', parameters('existingMobileNetworkName'), parameters('siteName'))]"
          }
        ],
        "sku": "G0",
        "localDiagnosticsAccess": {
          "authenticationType": "Password"
        },
        "coreNetworkTechnology": "[parameters('coreNetworkTechnology')]",
        "platform": {
          "type": "AKS-HCI",
          "customLocation": "[if(empty(parameters('customLocation')), null(), createObject('id', parameters('customLocation')))]",
          "azureStackEdgeDevice": {
            "id": "[parameters('azureStackEdgeDevice')]"
          }
        },
        "controlPlaneAccessInterface": {
          "ipv4Address": "[parameters('controlPlaneAccessIpAddress')]",
          "name": "[parameters('controlPlaneAccessInterfaceName')]"
        },
        "installation": {
          "desiredState": "[parameters('desiredState')]"
        },
        "ueMtu": "[parameters('ueMtu')]"
      },
      "dependsOn": [
        "[resourceId('Microsoft.MobileNetwork/mobileNetworks/sites', parameters('existingMobileNetworkName'), parameters('siteName'))]"
      ]
    }
  ]
}

範本中定義了四個 Azure 資源。

部署範本

  1. 選取下列連結以登入 Azure 並開啟範本。

    Button to deploy the Resource Manager template to Azure.

  1. 使用您在必要條件中擷取的信息,選取或輸入下列值。

    欄位
    訂用帳戶 選取您用來建立私人行動網路的 Azure 訂用帳戶。
    資源群組 選取包含代表私人行動網路之行動網路資源的資源群組。
    區域 選取您已部署私人行動網路的區域。
    地點 輸入您部署私人行動網路之區域的代碼名稱
    現有的行動網路名稱 輸入代表私人行動網路的行動網路資源名稱。
    現有的數據網路名稱 輸入數據網路的名稱。 此值必須符合您在建立資料網路時所使用的名稱。
    網站名稱 輸入網站的名稱。
    Azure Stack Edge 裝置 在網站中輸入 Azure Stack Edge 資源的資源識別碼。
    控制平面存取介面名稱 在 Azure Stack Edge Pro GPU 裝置上的埠 5 上輸入虛擬網路名稱,其對應至存取網路上的控制平面介面。 對於 5G,此介面是 N2 介面;針對 4G,它是 S1-MME 介面;針對合併的 4G 和 5G,它是 N2/S1-MME 介面。
    控制平面存取IP位址 輸入存取網路上控制平面介面的IP位址。
    用戶平面存取介面名稱 在 Azure Stack Edge Pro GPU 裝置上的埠 5 上輸入虛擬網路名稱,其對應至存取網路上的使用者平面介面。 對於 5G,這個介面是 N3 介面;針對 4G,它是 S1-U 介面;針對合併的 4G 和 5G,它是 N3/S1-U 介面。
    使用者平面數據介面名稱 在 Azure Stack Edge Pro GPU 裝置上的埠 6 上輸入虛擬網路名稱,其對應至數據網路上的使用者平面介面。 對於 5G,此介面是 N6 介面;針對 4G,它是 SGi 介面;針對合併的 4G 和 5G,它是 N6/SGi 介面。
    用戶設備位址池前置詞 輸入子網的網路位址,其中動態IP位址必須配置給CIDR表示法中的UE。 如果您不想支援動態IP位址配置,可以省略此專案。
    用戶設備靜態位址池前置詞 輸入子網的網路位址,其中靜態IP位址必須配置給CIDR表示法中的UE。 如果您不想支持靜態 IP 位址配置,可以省略此專案。
    核心網路技術 針對 5G 輸入 5GC、4G 的 EPC,或針對合併的 4G 和 5G 輸入 EPC + 5GC
    已啟用 Napt 根據數據網路是否應該啟用網路位址和埠轉譯 (NAPT) 來設定此欄位。
    Dns 位址 輸入 DNS 伺服器位址。 如果您不需要 UE 執行 DNS 解析,或網路中的所有 UE 都會使用自己在本機設定的 DNS 伺服器,則應該省略此專案。
    自訂位置 在月臺的 Azure Stack Edge Pro 裝置上,輸入以 Azure Stack HCI 上 Azure Kubernetes Service (AKS-HCI) 叢集為目標之自定義位置的資源標識符。
  1. 使用您在必要條件中擷取的信息,選取或輸入下列值。

    欄位
    訂用帳戶 選取您用來建立私人行動網路的 Azure 訂用帳戶。
    資源群組 選取包含代表私人行動網路之行動網路資源的資源群組。
    區域 選取您已部署私人行動網路的區域。
    地點 輸入您部署私人行動網路之區域的代碼名稱
    現有的行動網路名稱 輸入代表私人行動網路的行動網路資源名稱。
    現有的數據網路名稱 輸入數據網路的名稱。 此值必須符合您在建立資料網路時所使用的名稱。
    網站名稱 輸入網站的名稱。
    Azure Stack Edge 裝置 在網站中輸入 Azure Stack Edge 資源的資源識別碼。
    控制平面存取介面名稱 在 Azure Stack Edge Pro 2 裝置上的埠 3 上輸入虛擬網路名稱,其對應至存取網路上的控制平面介面。 對於 5G,此介面是 N2 介面;針對 4G,它是 S1-MME 介面;針對合併的 4G 和 5G,它是 N2/S1-MME 介面。
    控制平面存取IP位址 輸入存取網路上控制平面介面的IP位址。
    用戶平面存取介面名稱 在您的 Azure Stack Edge Pro 2 裝置上輸入埠 3 上的虛擬網路名稱,其對應至存取網路上的使用者平面介面。 對於 5G,這個介面是 N3 介面;針對 4G,它是 S1-U 介面;針對合併的 4G 和 5G,它是 N3/S1-U 介面。
    使用者平面數據介面名稱 在 Azure Stack Edge Pro 2 裝置上的埠 4 上輸入虛擬網路名稱,其對應至數據網路上的使用者平面介面。 對於 5G,此介面是 N6 介面;針對 4G,它是 SGi 介面;針對合併的 4G 和 5G,它是 N6/SGi 介面。
    用戶設備位址池前置詞 輸入子網的網路位址,其中動態IP位址必須配置給CIDR表示法中的UE。 如果您不想支援動態IP位址配置,可以省略此專案。
    用戶設備靜態位址池前置詞 輸入子網的網路位址,其中靜態IP位址必須配置給CIDR表示法中的UE。 如果您不想支持靜態 IP 位址配置,可以省略此專案。
    核心網路技術 針對 5G 輸入 5GC、4G 的 EPC,或針對合併的 4G 和 5G 輸入 EPC + 5GC
    已啟用 Napt 根據數據網路是否應該啟用網路位址和埠轉譯 (NAPT) 來設定此欄位。
    Dns 位址 輸入 DNS 伺服器位址。 如果您不需要 UE 執行 DNS 解析,或網路中的所有 UE 都會使用自己在本機設定的 DNS 伺服器,則應該省略此專案。
    自訂位置 在月臺的 Azure Stack Edge Pro 裝置上,輸入以 Azure Stack HCI 上 Azure Kubernetes Service (AKS-HCI) 叢集為目標之自定義位置的資源標識符。
  1. 選取 [檢閱 + 建立]。

  2. 現在 Azure 會驗證您輸入的設定值。 您應該會看到指出您的值已通過驗證的訊息。

    如果驗證失敗,您會看到錯誤訊息,且將標示包含無效組態的 [組態] 索引標籤。 選取標幟的索引標籤,並使用錯誤訊息更正無效的設定,再返回 [ 檢閱 + 建立 ] 索引標籤。

  3. 驗證過設定之後,您可以選取 [建立] 以建立網站。 建立網站時,Azure 入口網站 會顯示確認畫面。

檢閱已部署的資源

  1. 在確認畫面上,選取 [移至資源群組]。

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

  2. 確認資源群組包含下列新資源:

    • 代表 整個月臺的行動網站 資源。
    • 代表 站台中封包核心實例的控制平面函式的封包核心控制平面 資源。
    • 包核心數據平面 資源,代表站台中封包核心實例的數據平面函式。
    • 代表數據網路的月台檢視的附加數據網路資源。

    Screenshot of the Azure portal showing a resource group containing a site and its related resources.

下一步

如果您決定設定 Microsoft Entra ID 以進行本機監視存取,請遵循修改站台中的本機存取設定和啟用本機監視工具的 Microsoft Entra ID 中的步驟。

如果您尚未這麼做,則現在應該為私人行動網路設計原則控制組態。 這可讓您自定義封包核心實例如何將服務品質 (QoS) 特性套用至流量。 您也可以封鎖或限制特定流程。 若要深入瞭解如何設計私人行動網路的原則控制組態,請參閱 原則控制