Skip to content

Latest commit

 

History

History
226 lines (167 loc) · 12.4 KB

how-to-data-source-plugins-managed-identity.md

File metadata and controls

226 lines (167 loc) · 12.4 KB
title description author ms.author ms.service ms.topic ms.date
How to manage data sources for Azure Managed Grafana
In this how-to guide, discover how you can add, configure and remove data sources for Azure Managed Grafana.
maud-lv
malev
managed-grafana
how-to
12/08/2023

How to manage data sources in Azure Managed Grafana

In this guide, you learn about data sources supported in each Azure Managed Grafana plan and learn how to add, manage and remove these data sources.

Prerequisites

Supported Grafana data sources

By design, Grafana can be configured with multiple data sources. A data source is an externalized storage backend that holds telemetry information.

Grafana built-in core data sources

Azure Managed Grafana supports many popular data sources. The table below lists the Grafana core data sources that can be added to Azure Managed Grafana for each service tier.

Data sources Essential (preview) Standard
Alertmanager -
AWS CloudWatch -
Azure Data Explorer -
Azure Monitor
Elasticsearch -
GitHub -
Google Cloud Monitoring -
Graphite -
InfluxDB -
Jaeger -
JSON API -
Loki -
Microsoft SQL Server -
MySQL -
OpenTSDB -
PostgreSQL -
Prometheus
Tempo -
TestData
Zipkin -

Grafana Enterprise data sources

Within the Standard service tier, users who have subscribed to the Grafana Enterprise option can also access the following data sources.

Other data sources

Customers with a Standard tier plan can access additional data sources from the Plugin management (preview) feature.

For more information about data sources, go to Data sources on the Grafana Labs website.

Add a data source

To add a data source to Azure Managed Grafana, follow the steps below.

  1. Core Grafana plugins are installed in your workspace by default. If you want to use another type of data source, you first need to install its plugin. To install a new data source plugin, follow the instructions available at Add a plugin.

  2. Add the data source to your instance.

    1. Open your Azure Managed Grafana workspace in the Azure portal and go to Overview > Endpoint to open the Grafana UI.
    2. In the Grafana portal, deploy the menu on the left and select Connections > Data sources > Add new data source.
    3. Select a data source from the list. The data source is added to your instance.
    4. Fill out the required fields and select Save & test to update the data source configuration and make sure it works.

    :::image type="content" source="media/data-sources/add-data-source.png" alt-text="Screenshot of the Add data source page in Grafana.":::

Run the az grafana data-source create command to add a Grafana core data source with the Azure CLI.

For example, to add an Azure SQL data source, run:


az grafana data-source create --name <instance-name> --definition '{
  "access": "proxy",
  "database": "testdb",
  "jsonData": {
    "authenticationType": "SQL Server Authentication",
    "encrypt": "false"
  },
  "secureJsonData": {
    "password": "verySecretPassword"
  },
  "name": "Microsoft SQL Server",
  "type": "mssql",
  "url": "<url>",
  "user": "<user>"
}'

Tip

If you can't connect to a data source, you may need to modify access permissions to allow access from your Azure Managed Grafana instance.

Configure a data source

The content below shows how to configure some of the most popular data sources in Azure Managed Grafana: Azure Monitor and Azure Data Explorer. A similar process can be used to configure other types of data sources. For more information about a specific data source, refer to Grafana's documentation.

Azure Monitor

The Azure Monitor data source is automatically added to all new Managed Grafana resources. To review or modify its configuration, follow the steps below in the Grafana portal of your Azure Managed Grafana instance or in the Azure CLI.

  1. Deploy the menu on the left and select Connections > Data sources.

    :::image type="content" source="media/data-sources/configuration.png" alt-text="Screenshot of the Add data sources page.":::

  2. Azure Monitor is listed as a built-in data source for your Managed Grafana instance. Select Azure Monitor.

  3. In the Settings tab, authenticate through Managed Identity and select your subscription from the dropdown list or enter your App Registration details

    :::image type="content" source="media/data-sources/configure-Azure-Monitor.png" alt-text="Screenshot of the Azure Monitor page in data sources.":::

Authentication and authorization are made through the provided managed identity. Using managed identity, lets you assign permissions for your Managed Grafana instance to access Azure Monitor data without having to manually manage service principals in Microsoft Entra ID.

Run the az grafana data-source update command to update the configuration of your Azure Monitor data sources using the Azure CLI.

For example:


az grafana data-source update --data-source 'Azure Monitor' --name <instance-name> --definition '{ 
  "datasource": {
    "access": "proxy",
    "basicAuth": false,
    "basicAuthUser": "",
    "database": "",
    "id": 1,
    "isDefault": false,
    "jsonData": {
      "azureAuthType": "msi",
      "subscriptionId": "<subscription-ID>"
    },
    "name": "Azure Monitor",
    "orgId": 1,
    "readOnly": false,
    "secureJsonFields": {},
    "type": "grafana-azure-monitor-datasource",
    "typeLogoUrl": "",
    "uid": "azure-monitor-oob",
    "url": "",
    "user": "",
    "version": 1,
    "withCredentials": false
  },
  "id": 1,
  "message": "Datasource updated",
  "name": "Azure Monitor"
}

Note

User-assigned managed identity isn't currently supported.

Azure Data Explorer

To learn how to configure Azure Data Explorer, go to Configure Azure Data Explorer.

Remove a data source

This section describes the steps for removing a data source.

Caution

Removing a data source that is used in a dashboard will make the dashboard unable to collect the corresponding data and will trigger an error or result in no data being shown in the panel.

Remove a data source in the Azure portal:

  1. Open your Azure Managed Grafana instance in the Azure portal.
  2. Select Overview from the left menu, then open the Endpoint URL.
  3. In the Grafana portal, go to Connections > Your connections
  4. Select the data source you want to remove and select Delete.

Run the az grafana data-source delete command to remove an Azure Managed Grafana data source using the Azure CLI. In the sample below, replace the placeholders <instance-name> and <id> with the name of the Azure Managed Grafana workspace and the name, ID or UID of the data source.

az grafana data-source delete --name <instance-name> --data-source <id>

Next steps

[!div class="nextstepaction"] Create a dashboard