Quickstart: Deploy a private mobile network and site - Azure CLI
Azure Private 5G Core is an Azure cloud service for deploying and managing 5G core network functions on an Azure Stack Edge device, as part of an on-premises private mobile network for enterprises. This quickstart describes how to use an Azure CLI to deploy the following resources in the East US Azure region. See Products available by region for the Azure regions where Azure Private 5G Core is available.
- A private mobile network.
- A site.
- The default service and allow-all SIM policy (as described in Default service and allow-all SIM policy).
- Optionally, one or more SIMs, and a SIM group.
Use the Bash environment in Azure Cloud Shell. For more information, see Quickstart for Bash in Azure Cloud Shell.
If you prefer to run CLI reference commands locally, install the Azure CLI. If you're running on Windows or macOS, consider running Azure CLI in a Docker container. For more information, see How to run the Azure CLI in a Docker container.
If you're using a local installation, sign in to the Azure CLI by using the az login command. To finish the authentication process, follow the steps displayed in your terminal. For other sign-in options, see Sign in with the Azure CLI.
When you're prompted, install the Azure CLI extension on first use. For more information about extensions, see Use extensions with the Azure CLI.
Run az version to find the version and dependent libraries that are installed. To upgrade to the latest version, run az upgrade.
Prerequisite: Prepare to deploy a private mobile network and site
- Complete the prerequisite tasks for deploying a private mobile network and Commission the AKS cluster.
- Ensure you can sign in to the Azure portal using an account with access to the active subscription you identified in Complete the prerequisite tasks for deploying a private mobile network. This account must have the built-in Contributor or Owner role at the subscription scope.
- Collect the required information to deploy a private mobile network. If you want to provision SIMs, you'll need to prepare a JSON file containing your SIM information, as described in JSON file format for provisioning SIMs.
- Identify the names of the interfaces corresponding to ports 5 and 6 on the Azure Stack Edge Pro device in the site.
- Collect the required information for a site.
- Refer to the release notes for the current version of packet core, and whether it's supported by the version your Azure Stack Edge (ASE) is currently running. If your ASE version is incompatible with the latest packet core, update your Azure Stack Edge Pro GPU.
Azure CLI commands used in this article
- az mobile-network create
- az mobile-network site create
- az mobile-network pccp create
- az mobile-network pcdp create
- az mobile-network data-network create
- az mobile-network sim group create
- az mobile-network slice create
- az mobile-network service create
- az mobile-network sim policy create
- az mobile network sim create
- az mobile-network attached-data-network create
Launch Azure Cloud Shell
The Azure Cloud Shell is a free interactive shell that you can use to run the steps in this article. It has common Azure tools preinstalled and configured to use with your account.
To open the Cloud Shell, just select Try it from the upper right corner of a code block. You can also launch Cloud Shell in a separate browser tab by going to https://shell.azure.com.
When Cloud Shell opens, verify that Bash is selected for your environment. Subsequent sessions will use Azure CLI in a Bash environment, Select Copy to copy the blocks of code, paste it into the Cloud Shell, and press Enter to run it.
Sign in to Azure
Cloud Shell is automatically authenticated under the initial account signed-in with. Use the following script to sign in using a different subscription, replacing subscriptionId with your Azure subscription ID.
If you don't have an Azure subscription, create an Azure free account before you begin.
subscription="subscriptionId" # Set Azure subscription ID here
az account set -s $subscription # ...or use 'az login'
For more information, see set active subscription or log in interactively.
Deploy a private mobile network, site and SIM
You must complete the following steps in order to successfully deploy a private mobile network, site and SIM. Each step must be fully complete before proceeding to the next.
Create a Mobile Network resource
Use az mobile-network create
to create a new Mobile Network resource. The example command uses the following placeholder values, replace them with the information gathered in Prerequisite: Prepare to deploy a private mobile network and site.
Placeholder | Value |
---|---|
<MOBILENETWORK> |
Enter a name for the private mobile network. |
<RESOURCEGROUP> |
Enter the name of the resource group. |
az mobile-network create --location eastus -n <MOBILENETWORK> -g <RESOURCEGROUP> --identifier mcc=001 mnc=01
Create a Site resource
Use az mobile-network site
to create a new Site resource. The example command uses the following placeholder values, replace them with the information gathered in Prerequisite: Prepare to deploy a private mobile network and site.
Placeholder | Value |
---|---|
<MOBILENETWORK> |
Enter the name of the private mobile network you created. |
<SITE> |
Enter the name for the site. |
<RESOURCEGROUP> |
Enter the name of the resource group. |
az mobile-network site create --mobile-network-name <MOBILENETWORK> -n <SITE> -g <RESOURCEGROUP>
Create a Packet Core Control Plane resource
Use az mobile-network pccp create
to create a new Packet Core Control Plane resource. The example command uses the following placeholder values, replace them with the information gathered in Prerequisite: Prepare to deploy a private mobile network and site.
Placeholder | Value |
---|---|
<ASE> |
Enter the name of the ASE. |
<CUSTOMLOCATION> |
Enter the name of the custom location. |
<MOBILENETWORK> |
Enter the name of the mobile network. |
<RESOURCEGROUP> |
Enter the name of the resource group. |
<CONTROLPLANE> |
Enter the name for the packet core control plane. |
<SITE> |
Enter the name of the site. |
<IPV4ADDRESS> |
Enter the IPv4 address of the site. |
Obtain the ASE ID and assign it to a variable.
ASE_ID=$(databoxedge device show --device-name <ASE> -g <RESOURCEGROUP> --query "id")
Obtain the custom location ID and assign it to a variable.
CUSTOM_LOCATION_ID=$(customlocation show --name <CUSTOMLOCATION> -g <RESOURCEGROUP> --query "id")
Obtain the site ID and assign it to a variable.
SITE_ID=$(mobile-network site show --mobile-network-name <MOBILENETWORK> -g <RESOURCEGROUP> -n <SITE> --query "id")
Create the packet core control plane.
az mobile-network pccp create -n <CONTROLPLANE> -g <RESOURCEGROUP> --access-interface name=N2 ipv4Address=<IPV4ADDRESS> --local-diagnostics authentication-type=Password --platform type=AKS-HCI azure-stack-edge-device="{id:$ASE_ID}" customLocation="{id:$CUSTOM_LOCATION_ID}" --sites "[{id:$SITE_ID}]" --sku G0 --location eastus
Create a Packet Core Data Plane resource
Use az mobile-network pcdp create
to create a new Packet Core Data Plane resource. The example command uses the following placeholder values, replace them with the information gathered in Prerequisite: Prepare to deploy a private mobile network and site.
Placeholder | Value |
---|---|
<DATAPLANE> |
Enter the name for the data plane. |
<RESOURCEGROUP> |
Enter the name of the resource group. |
<CONTROLPLANE> |
Enter the name of the packet core control plane. |
az mobile-network pcdp create -n <DATAPLANE> -g <RESOURCEGROUP> --pccp-name <CONTROLPLANE> --access-interface name=N3
Create a Data Network
Use az mobile-network data-network create
to create a new Data Network resource. The example command uses the following placeholder values, replace them with the information gathered in Prerequisite: Prepare to deploy a private mobile network and site.
Placeholder | Value |
---|---|
<DATANETWORK> |
Enter the name for the data network. |
<RESOURCEGROUP> |
Enter the name of the resource group. |
<MOBILENETWORK> |
Enter the name of the private mobile network. |
az mobile-network data-network create -n <DATANETWORK> -g <RESOURCEGROUP> --mobile-network-name <MOBILENETWORK> --location eastus
Create a SIM Group
Use az mobile-network sim group create
to create a new Packet Core Data Plane resource. The example command uses the following placeholder values, replace them with the information gathered in Prerequisite: Prepare to deploy a private mobile network and site.
Use `` to create a new SIM Group. The example command uses the following placeholder values, replace them with the information gathered in Prerequisite: Prepare to deploy a private mobile network and site.
Variable | Placeholder | Value |
---|---|---|
<MOBILENETWORK> |
Enter the name of the private mobile network. | |
<SIMGROUP> |
Enter the name for the sim group. | |
<RESOURCEGROUP> |
Enter the name of the resource group. |
Obtain the mobile network ID and assign it to a variable.
NETWORK_ID=$(mobile-network show --mobile-network-name <MOBILENETWORK> -g <RESOURCEGROUP> --query "id")
Create the SIM group.
az mobile-network sim group create -n <SIMGROUP> -g <RESOURCEGROUP> --mobile-network "{id:$NETWORK_ID}"
Create a Slice
Use az mobile-network slice create
to create a new Slice. The example command uses the following placeholder values, replace them with the information gathered in Prerequisite: Prepare to deploy a private mobile network and site.
Placeholder | Value |
---|---|
<MOBILENETWORK> |
Enter the name for the private mobile network. |
<RESOURCEGROUP> |
Enter the name of the resource group. |
<SLICE> |
Enter the name of the slice. |
az mobile-network slice create --mobile-network-name <MOBILENETWORK> -n <SLICE> -g <RESOURCEGROUP> --snssai "{sst:1,sd:123abc}"
Create a Service
Use az mobile-network service create
to create a new Service. The example command uses the following placeholder values, replace them with the information gathered in Prerequisite: Prepare to deploy a private mobile network and site.
Placeholder | Value |
---|---|
<SERVICE> |
Enter the name of the service. |
<MOBILENETWORK> |
Enter the name for the private mobile network. |
<RESOURCEGROUP> |
Enter the name of the resource group. |
az mobile-network service create -n <SERVICE> -g <RESOURCEGROUP> --mobile-network-name <MOBILENETWORK> --pcc-rules "[{ruleName:default-rule,rulePrecedence:10,serviceDataFlowTemplates:[{templateName:IP-to-server,direction:Uplink,protocol:[ip],remoteIpList:[10.3.4.0/24]}]}]" --service-precedence 10
Create a SIM Policy
Use az mobile-network sim policy create
to create a new SIM Policy. The example command uses the following placeholder values, replace them with the information gathered in Prerequisite: Prepare to deploy a private mobile network and site.
Placeholder | Value |
---|---|
<SLICE> |
Enter the name of the slice. |
<DATANETWORK> |
Enter the name of the data network. |
<SERVICE> |
Enter the name of the service. |
<RESOURCEGROUP> |
Enter the name of the resource group. |
<SIMPOLICY> |
Enter the name for the SIM policy. |
<MOBILENETWORK> |
Enter the name for the private mobile network. |
Obtain the slice ID and assign it to a variable.
SLICE_ID=$(mobile-network slice show --mobile-network-name <MOBILENETWORK> -g <RESOURCEGROUP> -n <SLICE> --query "id")
Obtain the data network ID and assign it to a variable.
DATANETWORK_ID=$(mobile-network data-network show -n <DATANETWORK> --mobile-network-name <MOBILENETWORK> -g <RESOURCEGROUP> --query "id")
Obtain the service ID and assign it to a variable.
SERVICE_ID=$(mobile-network service show -n <SERVICE> --mobile-network-name <MOBILENETWORK> -g <RESOURCEGROUP> --query "id")
Create the SIM policy.
az mobile-network sim policy create -g <RESOURCEGROUP> -n <SIMPOLICY> --mobile-network-name <MOBILENETWORK> --default-slice '{id:$SLICE_ID}' --slice-config "[{slice:{id:$SLICE_ID},defaultDataNetwork:{id:$DATANETWORK_ID},dataNetworkConfigurations:[{dataNetwork:{id:$DATANETWORK_ID},allowedServices:[{id:$SERVICE_ID}],sessionAmbr:{uplink:'500 Mbps',downlink:'1 Gbps'}}]}]" --ue-ambr "{uplink:'500 Mbps',downlink:'1 Gbps'}" --location eastus
Create a SIM
Use az mobile-network sim create
to create a new SIM. The example command uses the following placeholder values, replace them with the information gathered in Prerequisite: Prepare to deploy a private mobile network and site.
Placeholder | Value |
---|---|
<SIMGROUP> |
Enter the name of the SIM group. |
<SIM> |
Enter the name for the SIM. |
<RESOURCEGROUP> |
Enter the name of the resource group. |
az mobile-network sim create -g <RESOURCEGROUP> --sim-group-name <SIMGROUP> -n <SIM> --international-msi 0000000000 --operator-key-code 00000000000000000000000000000000 --authentication-key 00000000000000000000000000000000
Attach the Data Network
Use az mobile-network attached-data-network create
to attach the Data Network you created. The example command uses the following placeholder values, replace them with the information gathered in Prerequisite: Prepare to deploy a private mobile network and site.
Placeholder | Value |
---|---|
<DATANETWORK> |
Enter the name for the data network. |
<CONTROLPLANE> |
Enter the name of the packet core control plane. |
<DATAPLANE> |
Enter the name of the packet core data plane. |
<RESOURCEGROUP> |
Enter the name of the resource group. |
az mobile-network attached-data-network create -n <DATANETWORK> -g <RESOURCEGROUP> --pccp-name <CONTROLPLANE> --pcdp-name <DATAPLANE> --dns-addresses "[1.1.1.1]" --data-interface name=N6 --address-pool 192.168.1.0/24
Clean up resources
If you do not want to keep your deployment, delete the resource group.
Next steps
If you have kept your deployment, you can either begin designing policy control to determine how your private mobile network handles traffic, or you can add more sites to your private mobile network.