你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

使用 ARM 模板创建站点

Azure 专用 5G 核心专用移动网络包含一个或多个站点。 每个站点代表一个实体企业位置(例如,Contoso Corporation 在芝加哥的工厂),其中包含一个托管数据包核心实例的 Azure Stack Edge 设备。 本操作指南介绍如何使用 Azure 资源管理器模板(ARM 模板)在专用移动网络中创建站点。

Azure 资源管理器模板是定义项目基础结构和配置的 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 门户。 此帐户必须具有订阅范围的内置参与者角色。
  • 如果新站点将支持 4G 用户设备 (UE),则你必须事先创建一个网络切片,其切片/服务类型 (SST) 值为 1,切片差分器值 (SD) 为空。

查看模板

本操作指南中使用的模板来自 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 资源的资源 ID。
    控制平面访问接口名称 在 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 接口。
    用户设备地址池前缀 输入以 CIDR 表示法表示的子网网络地址,必须将其中的动态 IP 地址分配给 UE。 如果不想支持动态 IP 地址分配,可以省略此项。
    用户设备静态地址池前缀 输入以 CIDR 表示法表示的子网网络地址,必须将其中的静态 IP 地址分配给 UE。 如果不想支持静态 IP 地址分配,可以省略此项。
    核心网络技术 对于 5G,输入“5GC”;对于 4G,输入“EPC”;对于 4G 和 5G 组合,输入“EPC + 5GC”。
    已启用 Napt 根据是否应为数据网络启用网络地址和端口转换 (NAPT) 来设置此字段。
    DNS 地址 输入 DNS 服务器地址。 如果不需要 UE 来执行 DNS 解析,或者网络中的所有 UE 都将使用自己本地配置的 DNS 服务器,才应省略此配置。
    自定义位置 输入自定义位置的资源 ID,该位置以站点中 Azure Stack Edge Pro 设备上 Azure Stack HCI (AKS-HCI) 群集中的 Azure Kubernetes 服务为目标。
  1. 使用在先决条件中检索的信息,选择或输入以下值。

    字段
    订阅 选择在创建专用移动网络时使用的 Azure 订阅。
    资源组 选择包含代表该专用移动网络的移动网络资源的资源组。
    区域 选择部署专用移动网络的区域。
    位置 输入你部署专用移动网络的区域的代码名称
    现有移动网络名称 输入代表专用移动网络的移动网络资源的名称。
    现有数据网络名称 输入数据网络的名称。 此值必须与创建数据网络时使用的名称相匹配。
    站点名称 输入站点的名称。
    Azure Stack Edge 设备 在站点中输入 Azure Stack Edge 资源的资源 ID。
    控制平面访问接口名称 在 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 接口。
    用户设备地址池前缀 输入以 CIDR 表示法表示的子网网络地址,必须将其中的动态 IP 地址分配给 UE。 如果不想支持动态 IP 地址分配,可以省略此项。
    用户设备静态地址池前缀 输入以 CIDR 表示法表示的子网网络地址,必须将其中的静态 IP 地址分配给 UE。 如果不想支持静态 IP 地址分配,可以省略此项。
    核心网络技术 对于 5G,输入“5GC”;对于 4G,输入“EPC”;对于 4G 和 5G 组合,输入“EPC + 5GC”。
    已启用 Napt 根据是否应为数据网络启用网络地址和端口转换 (NAPT) 来设置此字段。
    DNS 地址 输入 DNS 服务器地址。 如果不需要 UE 来执行 DNS 解析,或者网络中的所有 UE 都将使用自己本地配置的 DNS 服务器,才应省略此配置。
    自定义位置 输入自定义位置的资源 ID,该位置以站点中 Azure Stack Edge Pro 设备上 Azure Stack HCI (AKS-HCI) 群集中的 Azure Kubernetes 服务为目标。
  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) 特征的方式。 还可以阻止或限制特定的流。 请参阅策略控制来详细了解如何为专用移动网络设计策略控制配置。