Enable Microsoft Entra ID for local monitoring tools
Azure Private 5G Core provides the distributed tracing and packet core dashboards tools for monitoring your deployment at the edge. You can access these tools using Microsoft Entra ID or a local username and password. We recommend setting up Microsoft Entra authentication to improve security in your deployment.
In this how-to guide, you'll carry out the steps you need to complete after deploying or configuring a site that uses Microsoft Entra ID to authenticate access to your local monitoring tools. You don't need to follow this if you decided to use local usernames and passwords to access the distributed tracing and packet core dashboards.
Microsoft Entra ID for local monitoring tools is not supported when a web proxy is enabled on the Azure Stack Edge device on which Azure Private 5G Core is running. If you have configured a firewall that blocks traffic not transmitted via the web proxy, then enabling Microsoft Entra ID will cause the Azure Private 5G Core installation to fail.
- You must have completed the steps in Complete the prerequisite tasks for deploying a private mobile network and Collect the required information for a site.
- You must have deployed a site with Microsoft Entra ID set as the authentication type.
- Identify the IP address for accessing the local monitoring tools that you set up in Management network.
- Ensure you can sign in to the Azure portal using an account with access to the active subscription you used to create your private mobile network. This account must have permission to manage applications in Microsoft Entra ID. Microsoft Entra built-in roles that have the required permissions include, for example, Application administrator, Application developer, and Cloud application administrator. If you do not have this access, contact your tenant Microsoft Entra administrator so they can confirm your user has been assigned the correct role by following Assign user roles with Microsoft Entra ID.
- Ensure your local machine has core kubectl access to the Azure Arc-enabled Kubernetes cluster. This requires a core kubeconfig file, which you can obtain by following Core namespace access.
Configure domain system name (DNS) for local monitoring IP
When registering your application and configuring redirect URIs, you'll need your redirect URIs to contain a domain name rather than an IP address for accessing the local monitoring tools.
In the authoritative DNS server for the DNS zone you want to create the DNS record in, configure a DNS record to resolve the domain name to the IP address used for accessing local monitoring tools, which you set up in Management network.
You'll now register a new local monitoring application with Microsoft Entra ID to establish a trust relationship with the Microsoft identity platform.
If your deployment contains multiple sites, you can use the same two redirect URIs for all sites, or create different URI pairs for each site. You can configure a maximum of two redirect URIs per site. If you've already registered an application for your deployment and you want to use the same URIs across your sites, you can skip this step.
Follow Quickstart: Register an application with the Microsoft identity platform to register a new application for your local monitoring tools with the Microsoft identity platform.
In Add a redirect URI, select the Web platform and add the following two redirect URIs, where <local monitoring domain> is the domain name for your local monitoring tools that you set up in Configure domain system name (DNS) for local monitoring IP:
- https://<local monitoring domain>/sas/auth/aad/callback
- https://<local monitoring domain>/grafana/login/azuread
In Add credentials, follow the steps to add a client secret. Make sure to record the secret under the Value column, as this field is only available immediately after secret creation. This is the Client secret value that you'll need later in this procedure.
Follow App roles UI to create three roles for your application (Admin, Viewer, and Editor) with the following configuration:
- In Allowed member types, select Users/Groups.
- In Value, enter one of Admin, Viewer, and Editor for each role you're creating.
- In Do you want to enable this app role?, ensure the checkbox is selected.
You'll be able to use these roles when managing access to the packet core dashboards.
Follow Assign users and groups to roles to assign users and groups to the roles you created.
Collect the information for Kubernetes Secret Objects
Collect the values in the following table.
Value How to collect Kubernetes secret parameter name Tenant ID In the Azure portal, search for Microsoft Entra ID. You can find the Tenant ID field in the Overview page.
Application (client) ID Navigate to the new local monitoring app registration you just created. You can find the Application (client) ID field in the Overview page, under the Essentials heading.
Authorization URL In the local monitoring app registration Overview page, select Endpoints. Copy the contents of the OAuth 2.0 authorization endpoint (v2) field.
If the string contains
organizationswith the Tenant ID value. For example,
Token URL In the local monitoring app registration Overview page, select Endpoints. Copy the contents of the OAuth 2.0 token endpoint (v2) field.
If the string contains
organizationswith the Tenant ID value. For example,
Client secret You collected this when creating the client secret in the previous step.
Distributed tracing redirect URI root Make a note of the following part of the redirect URI: https://<local monitoring domain>.
Packet core dashboards redirect URI root Make a note of the following part of the packet core dashboards redirect URI: https://<local monitoring domain>/grafana.
Modify local access
Go to the Azure portal and navigate to your site's Packet Core Control Plane resource. Select the blade's Modify local access tab.
- If the Authentication type is set to Microsoft Entra ID, continue to Create Kubernetes Secret Objects.
- Select Microsoft Entra ID from the Authentication type dropdown.
- Select Review.
- Select Submit.
Create Kubernetes Secret Objects
To support Microsoft Entra ID on Azure Private 5G Core applications, you'll need a YAML file containing Kubernetes secrets.
Convert each of the values you collected in Collect the information for Kubernetes Secret Objects into Base64 format. For example, you can run the following command in an Azure Cloud Shell Bash window:
echo -n <Value> | base64
Create a secret-azure-ad-local-monitoring.yaml file containing the Base64-encoded values to configure distributed tracing and the packet core dashboards. The secret for distributed tracing must be named sas-auth-secrets, and the secret for the packet core dashboards must be named grafana-auth-secrets.
apiVersion: v1 kind: Secret metadata: name: sas-auth-secrets namespace: core type: Opaque data: client_id: <Base64-encoded client ID> client_secret: <Base64-encoded client secret> redirect_uri_root: <Base64-encoded distributed tracing redirect URI root> tenant_id: <Base64-encoded tenant ID> --- apiVersion: v1 kind: Secret metadata: name: grafana-auth-secrets namespace: core type: Opaque data: client_id: <Base64-encoded client ID> client_secret: <Base64-encoded client secret> auth_url: <Base64-encoded authorization URL> token_url: <Base64-encoded token URL> root_url: <Base64-encoded packet core dashboards redirect URI root>
Apply Kubernetes Secret Objects
You'll need to apply your Kubernetes Secret Objects if you're enabling Microsoft Entra ID for a site, after a packet core outage, or after updating the Kubernetes Secret Object YAML file.
Apply the Secret Object for both distributed tracing and the packet core dashboards, specifying the core kubeconfig filename.
kubectl apply -f /home/centos/secret-azure-ad-local-monitoring.yaml --kubeconfig=<core kubeconfig>
Use the following commands to verify if the Secret Objects were applied correctly, specifying the core kubeconfig filename. You should see the correct Name, Namespace, and Type values, along with the size of the encoded values.
kubectl describe secrets -n core sas-auth-secrets --kubeconfig=<core kubeconfig>
kubectl describe secrets -n core grafana-auth-secrets --kubeconfig=<core kubeconfig>
Restart the distributed tracing and packet core dashboards pods.
Obtain the name of your packet core dashboards pod:
kubectl get pods -n core --kubeconfig=<core kubeconfig>" | grep "grafana"
Copy the output of the previous step and replace it into the following command to restart your pods.
kubectl delete pod sas-core-search-0 <packet core dashboards pod> -n core --kubeconfig=<core kubeconfig>
Update Kubernetes Secret Objects
Follow this step if you need to update your existing Kubernetes Secret Objects; for example, after updating your redirect URIs or renewing an expired client secret.
- Make the required changes to the Kubernetes Secret Object YAML file you created in Create Kubernetes Secret Objects.
- Apply Kubernetes Secret Objects.
- Verify access.
If you haven't already done so, you should now design the policy control configuration for your private mobile network. This allows you to customize how your packet core instances apply quality of service (QoS) characteristics to traffic. You can also block or limit certain flows.