Skip to main content
You can use OpenID Connect and your existing identity provider (IdP) framework to manage access to CDF data securely. We currently support Microsoft Entra ID, Microsoft’s cloud-based identity and access management service. Follow the steps below to connect to a CDF project with OpenID Connect and use CDF as a data source in Grafana. To build dashboards once the data source is set up, see Cognite Data Source for Grafana under Build. If the setup fails, see Troubleshooting.
To perform the steps below, you need to be an administrator of Microsoft Entra ID and your Grafana instance.

Before you start

Make sure that you have administrator access to your Grafana instance. We support the Enterprise, self-hosted and Cloud Pro editions of Grafana. We also support free cloud instances, but then you need to set up a client credentials grant flow for each instance of the Cognite Data Source.

Step 1: Register Grafana as an application in Microsoft Entra ID

The Cognite Data Source for Grafana uses the credentials you use to sign in to Grafana to connect to CDF. Therefore, you need to set up the Grafana instance to authenticate the user towards the same identity provider (IdP) as your CDF project. The first step is to configure the Grafana instance to use OAuth2. The example below uses Microsoft Entra ID as the IdP.
1

Register the Cognite API and CDF application

2

Enable Microsoft Entra ID authentication in Grafana

To enable users to sign in to Grafana with their organizational ID, follow the steps in the Grafana documentation to register Grafana as an application in Microsoft Entra ID and enable Microsoft Entra ID authentication in Grafana.
Grafana Cloud: To enable OIDC sign-in using Microsoft Entra ID with Grafana Cloud, follow the configuration steps.Handle the changes to the Grafana configuration file by using the configuration form at Grafana Labs > Security > Advanced Auth.
Use these permission scopes in the Grafana configuration file: scopes = openid email profile offline_access https://<your-cluster>.cognitedata.com/user_impersonation https://<your-cluster>.cognitedata.com/IDENTITY
If you are running Grafana locally, use http in the redirect URL. For example: http://localhost:3000/login/azuread.
3

Restart the Grafana service

Close the Grafana configuration file after updating it and restart the Grafana service.
4

Verify configuration as administrator

Sign in to Grafana to use the Microsoft Entra ID Global administrator role. The role lets you verify that the configuration is successful and enables you to grant admin consent.
5

Grant organization consent

Select Consent on behalf of your organization.

Step 2: Decide access to CDF data

1

Link Microsoft Entra ID and CDF groups

To decide what access users should have to data in CDF, follow the steps in Link Microsoft Entra ID and CDF groups.
2

Configure required capabilities

The groups a user belongs to need the capabilities to read the data the dashboards show:
  • groupsAcl:LIST and projectsAcl:LIST to verify the connection to CDF.
  • Read access to the data models, views, and instances the query tabs use. See Access control for data models and Time series in data models for data points.
  • Read access to records and streams for the Records tab. See Records.
  • For the deprecated asset-centric features, read access to time series, assets, and events. See Capabilities.

Step 3: Install the Cognite Data Source for Grafana

To install the Cognite Data Source for Grafana:
1

Sign in as administrator

Make sure you’re signed in to Grafana as an administrator in your browser.
2

Install the plugin

Navigate to the Cognite Data Source for Grafana plugin and select Install plugin.

Step 4: Configure the Cognite Data Source for Grafana

To configure the Cognite Data Source for Grafana:
1

Sign in to Grafana

In your browser, sign in to Grafana as an administrator.
2

Add the Cognite data source

In Grafana, navigate to Configuration > Data sources > Add data source > Search for “Cognite”.
The Add data source page filtered to Cognite Data Fusion
3

Configure the data source

Enter the project name in Project and the cluster hostname in Base URL, and turn on Forward OAuth Identity.
The Connection tab of the data source settings with the project, base URL, and Forward OAuth Identity on
The Grafana free tier doesn’t allow you to set an identity provider for the whole Grafana instance, and you can not select a Forward OAuth Identity. Instead, you need to set up a client credentials grant flow for each instance of the Cognite Data Source.
4

Save and test the configuration

Select Save & test to validate your Cognite credentials.
5

Verify the configuration

Verify that the configuration is successful: Sign in to Grafana with a non-admin identity and create a dashboard to confirm that regular users in your Microsoft Entra ID can access Grafana and work with data from CDF.
Learn more about managing Grafana at grafana.com and community.grafana.com.

Step 5: Turn on query tabs

Feature flags on the Features tab of the data source settings decide which query tabs users see in panels, and which tabs the variable editor shows.
1

Open the Features tab

In Grafana, open the settings of the Cognite data source and select the Features tab.
2

Choose a feature group

Under Core Data Model (CDM), make sure Enable CDM features is on.The core data model (CDM) features and the asset-centric features are mutually exclusive: turning on one group turns off the other. Asset-centric features are deprecated. Turn them on only to maintain existing dashboards. See Legacy features.
3

Turn on the tabs you need

Within the CDM group, the tabs in the table are on by default. Turn off the tabs you don’t want users to see.The Other group lists deprecated switches for Extraction Pipelines and Cognite Templates. Turn a switch on only to maintain a dashboard that already uses it.
The Features tab of the data source settings with the core data model feature flags on and the asset-centric group off
4

Save the settings

Select Save & test.
Variables that are already saved on a tab keep that tab, and keep resolving, when you turn off its feature flag.

Set up a client credentials grant flow

In some cases, for example, if you’re using the Grafana free tier, you can not set up an identity provider for the whole Grafana instance. Instead, follow these steps to set up a client credentials grant flow for each instance of the Cognite Data Source:

Before you start

1

Set up application registration

Use an application registration with capabilities to access the target CDF project. If you don’t have an application registration, follow the guide: Register a custom web app in Microsoft Entra ID.
2

Register Cognite API and CDF application

3

Configure required capabilities

Configure the required capabilities.
4

Add service principal to CDF group

5

Install the plugin

Navigate to Cognite Data Source for Grafana plugin and select Install plugin.
Follow these steps to set up client credentials grant flow:
1

Navigate to data sources

In Grafana, navigate to Configuration > Data sources > Add data source.
2

Select Cognite data source

Search for Cognite and select Cognite Data Fusion data source.
3

Configure OAuth2 client credentials

  1. Disable Forward OAuth identity.
  2. Enable OAuth2 client credentials.
  3. Enter the credentials.
4

Validate credentials

Select Save & test to validate your Cognite credentials.
The Connection tab with OAuth2 client credentials on and the token URL, client ID, client secret, and scope fields

Troubleshooting

Bad Gateway error when setting up the Base URL

Symptom When selecting Save & test in the CDF plugin configuration, the user gets a Bad Gateway error. The developer tab in Grafana has a 502 error in the network tab. Causes The Base URL in the setup is wrong, but the user only gets the Bad Gateway error message. Fixes Check that the Base URL field has a valid Cognite hostname.
  • If the project uses the default multi-tenant cluster (api.cognitedata.com), keep the default value and don’t change the hostname.
  • If the project uses another cluster, such as westeurope-1.cognitedata.com, set Base URL to that cluster’s hostname.
  • If you’re unsure, use the default hostname.
  • Do not use https:// or trailing slashes / in the Base URL field. The Token URL for client credentials is a full URL and does include https://.

A query tab or variable tab is missing

Symptom A query tab, such as GraphQL, Records, or Synthetic time series, or the Assets or GraphQL tab in the variable editor, doesn’t appear. Causes Each tab is controlled by a feature flag in the data source settings. Core data model (CDM) features and asset-centric features are mutually exclusive. Fixes Turn on the feature group and the feature flag for the tab you need. See Turn on query tabs.
Last modified on November 13, 2026