Configure an Azure Data Explorer datasource
Azure Data Explorer is a logs & telemetry data exploration service. In this guide, you learn how to add an Azure Data Explorer data source to Grafana and you learn how to configure Azure Data Explorer using each authentication option available for this data source.
Prerequisites
- An Azure Managed Grafana instance in the Standard plan.
- An Azure Data Explorer database
Add an Azure Data Explorer data source
Add an Azure Data Explorer data source to Grafana by following the steps below.
Open an Azure Managed Grafana instance in the Azure portal.
In the Overview section, open the Endpoint URL.
In the Grafana portal, deploy the menu on the left and select Connections > Connect data.
Select Azure Data Explorer Datasource from the list, and add it to Grafana by selecting Create a Azure Data Explorer Datasource data source.
Configure an Azure Data Explorer data source
Enter Azure Data Explorer configuration settings.
In the Settings tab, optionally edit the data source Name.
Under Connection Details, enter the Azure Data Explorer database Cluster URL.
Select your preferred authentication option between Managed Identity or Current User (user-based authentication).
Authenticate with a managed identity without using explicit credentials.
Add a new permission
In the Azure portal, open your Azure Data Explorer cluster.
In the Overview section, select the database that contains your data.
Select Permissions > Add > Viewer.
In the search box, enter your Azure Managed Grafana workspace name, select the workspace and then choose Select. A success notification appears.
Configure the data source in Grafana
- Back in Grafana, under Authentication Method, select Managed Identity.
- Select Save & test. The "Success" notification displayed indicates that Grafana is able to fetch data from the database.
Create an Azure Data Explorer data source
In the Azure CLI, add and configure an Azure Data Explorer data source, by running the az grafana data-source create command. Choose your preferred authentication method and refer to the corresponding tab below for details.
When running these commands, replace all placeholders with your own information.
Authenticate with a managed identity without using explicit credentials.
az grafana data-source create --name <azure-managed-grafana-workspace> --definition '{
"name": "<data-source-name>",
"type": "grafana-azure-data-explorer-datasource",
"access": "proxy",
"jsonData": {
"clusterUrl": "<cluster-url>",
"dataConsistency": "strongconsistency",
"azureCredentials": {
"authType": "msi"
}
}
}'
Update an Azure Data Explorer data source
To update an Azure Data Explorer data source, follow the steps below. When running these commands, replace all placeholders with your own information.
Get the ID of the Azure Data Explorer data source to update with az grafana data-source list.
az grafana data-source list --resource-group <azure-managed-grafana-resource-group> --name <azure-managed-grafana-workspace> --query "[?type=='grafana-azure-data-explorer-datasource'].id"
Run the az grafana data-source update command to update the data source.
For example, update the name and cluster URL of the Azure Data Explorer data source with the following command.
az grafana data-source update --resource-group <azure-managed-grafana-workspace-resource-group> --name <azure-managed-grafana-workspace> --data-source-id <data-source-id> --set name="<new-name>" url="<new-url>