As enterprise engineering teams scale their Azure Kubernetes Service (AKS) environments across dozens of clusters and thousands of microservices, observing the real-time health of those services becomes a massive architectural challenge. Historically, teams deployed open-source Prometheus and Grafana directly inside the Kubernetes clusters. However, this decentralized approach creates severe blind spots: if a cluster crashes, the Prometheus instance monitoring it also crashes, taking your dashboard down exactly when you need it most. Furthermore, managing the underlying storage for Prometheus metrics is highly complex. To resolve this, Microsoft introduced Azure Managed Grafana and Azure Monitor managed service for Prometheus, providing a fully managed, globally highly-available telemetry aggregation pipeline.
The Architecture of Managed Telemetry
By shifting to the managed services, you decouple the observability infrastructure from the compute infrastructure.
Instead of deploying a massive Prometheus server inside your AKS cluster, you deploy a lightweight Metrics Extension (a specialized Azure Monitor agent). This agent operates strictly as a forwarder. It utilizes the standard Prometheus scraping configuration (discovering endpoints via Kubernetes annotations or ServiceMonitors), scrapes the metrics locally, and immediately streams them over a secure TLS tunnel to the centralized Azure Monitor managed service for Prometheus.
Because the metrics are stored in the highly scalable Azure Monitor backend, you no longer have to manage persistent volumes (PVs), deal with out-of-memory (OOM) kills on your Prometheus pods, or configure complex federated scraping rules. The Azure Managed Grafana instance then connects directly to this centralized data store, providing a unified pane of glass across your entire global AKS estate.
Deploying the Managed Services
To deploy the architecture, you must first provision the two core Azure resources.
- Navigate to the Azure Portal and search for Azure Monitor workspace. Create a new workspace (this is the specialized backend that will store the Prometheus metrics).
- Search for Azure Managed Grafana and create a new instance. During creation, ensure you check the box labeled Include Azure Monitor workspace integration and select the workspace you created in step 1.
Azure automatically handles the complex Identity and Access Management (IAM) bindings, granting the Managed Grafana instance the Monitoring Data Reader role over the Azure Monitor workspace, ensuring mathematical security without manual service principal generation.
Configuring the AKS Cluster Integration
With the backend infrastructure deployed, you must instruct your AKS clusters to begin forwarding their telemetry.
The most efficient method to configure this is utilizing the Azure CLI. You need the Resource ID of your AKS cluster and the Resource ID of the Azure Monitor workspace.
# Enable the Prometheus Metrics addon on the AKS cluster
az aks update \
--name my-aks-cluster \
--resource-group my-resource-group \
--enable-azure-monitor-metrics \
--azure-monitor-workspace-resource-id "/subscriptions/.../providers/microsoft.monitor/accounts/my-workspace"
When this command executes, Azure dynamically deploys the ama-metrics daemonset onto your AKS nodes. Within minutes, the agent begins discovering all standard Kubernetes metrics (CPU, Memory, Network I/O) and forwarding them to the cloud.
Customizing Metric Scraping
While the default configuration captures infrastructure metrics, you must explicitly configure the agent to scrape custom application metrics (e.g., the number of active HTTP sessions in your Java Spring Boot microservice).
The ama-metrics agent reads a highly specific ConfigMap named ama-metrics-settings-configmap deployed in the kube-system namespace. By deploying this ConfigMap to your cluster, you can instruct the agent to utilize standard Prometheus annotations (e.g., prometheus.io/scrape: "true").
kind: ConfigMap
apiVersion: v1
metadata:
name: ama-metrics-settings-configmap
namespace: kube-system
data:
default-scrape-settings-enabled: "true"
pod-annotation-based-scraping: "true"
Once applied via kubectl apply -f configmap.yaml, the managed agent will begin dynamically tracking and scraping any pod annotated for Prometheus metrics. By utilizing Azure Managed Grafana and Prometheus, infrastructure teams achieve true, resilient, and infinitely scalable observability that survives localized cluster failures.