Before you start
Make sure you have registered the Cognite API and the CDF application in Microsoft Entra ID and set up Microsoft Entra ID and CDF groups to control access to CDF data.Step 1: Register an app in Microsoft Entra ID to use with PostgreSQL gateway
Sign in to Azure portal
Select tenant
Navigate to Microsoft Entra ID
Register new application
Copy application ID
Create client secret
- Under Manage, select Certificates & secrets.
- Select New client secret.
- Enter a client secret description.
- Select an expiry time.
- Select Add.
Copy client secret
Step 2: Create a group in Microsoft Entra ID and add the registered app as its member
Open groups
Create group
Add app as member
- Open the group. Under Manage, select Members > Add members.
- Find the app you created above and click Select.
Copy Object ID
Step 3: Create a group in CDF and link to the Microsoft Entra ID group
Navigate to CDF groups
Name the group
Add capabilities
postgresGateway:READpostgresGateway:WRITEproject:listgroups:listsession:CREATE
read and/or write capabilities for the CDF resources you want to ingest data into. For instance, if you’re ingesting assets, add asset:read and asset:write.Link to Microsoft Entra ID group
- In the Source ID field, enter the Object Id for the ME-ID group exactly as it exists in ME-ID.
- In the Source name field, enter the name of the group in Microsoft Entra ID.
Create group
Step 4: Create user credentials for the PostgreSQL gateway
Send POST request
https://{cluster}.cognitedata.com/api/v1/projects/{project}/postgresgateway API.clusteris where your CDF instance exists. If you don’t know the cluster name, contact Cognite support.projectis the organization name of your CDF instance.
Get Bearer token
Get session nonce
Provide nonce to API
Migrate to PostgreSQL gateway 2.0
The PostgreSQL gateway 2.0 replaces the previous version (1.0). As indicated in Step 4 above, this version usessessions on behalf of your project and OIDC authentication to make requests to CDF.
Most of the tables remain the same, but may have columns added or renamed. Some tables have been changed or divided up for clarity.
These modifications are highlighted below:
Assets
Table name: assets AddedEvent
Table name: events AddedExtraction pipeline runs
Table name: extraction_pipeline_runs AddedExtraction pipelines
Table name: extraction_pipelines AddedFiles
Table name: files AddedLabels
Table name: labels AddedSequences
Table name: sequences AddedSequence rows
Table name: sequence_rows ChangedDatapoints
Thedatapoints table has been divided into 2 different tables because version 1.0 only supported double datapoints. These are string_datapoints and double_datapoints.
It includes the following columns:
Timeseries
Thetimeseries table has been renamed to time_series.
Removed
The legacy_name field has been retired and is no longer available for use.
Raw
Theraw table is renamed to raw_rows for better understanding and proper differentiation between raw table data sets and raw table names.
raw_rows
Added