Before you start
- Make sure you have an Azure subscription and have created Azure resource groups.
- Make sure you have created an Azure storage account.
- Make sure you have the file containing the data to be ingested to CDF in Azure blob storage.
Step 1: Create a data factory
Sign in to Azure
- Sign in to the Azure portal as an admin.
- If you have access to multiple tenants, use the Directory + subscription filter in the top menu to select the tenant in which you want to register a data factory.
Navigate to Data Factory

Configure basics
- Subscription: Select the Azure subscription in which you want to create the data factory.
- Resource group: Create or select the Azure resource group you want to use.
- Region: Select a location where your ADF metadata will be stored. This list only shows locations that ADF supports.
- Name: Enter a globally unique name for the data factory.
- Version: Select V2.
Configure Git
Create data factory
Open Azure Data Factory application
Step 2: Create an ADF pipeline and set the source system
Use the Copy data tool to create a pipeline that reads data from a file in your data storage and writes to CDF.Create pipeline
Open Copy data activity
Configure source

Create linked service
- Enter a unique name for the service.
- Select your Azure subscription and storage account.
- Select Test connection to make sure you are connected to the selected storage account.
- Select Create.

Set properties
- Enter a unique name for the source data set.
- Browse to the file you want to use.
- Select First row as header to reuse the source file’s header columns.
- Select OK.
Step 3: Set PostgreSQL gateway as sink
In this step, add the PostgreSQL gateway as the destination using a sink in ADF.Open Sink tab
Create new sink dataset
Open sink dataset

Configure linked service
- Select New to add a linked service.
- Under Account selection method > Enter manually.
- In the Fully qualified domain name field, enter
fdw.{cluster}.cogniteapp.comwhere{cluster}is where your CDF instance is installed. If you don’t know the cluster name, contact Cognite support. - In the Port field, enter 5432, which is the default port for the PostgreSQL gateway.
- For Database name and User name, enter the username returned from the PostgreSQL gateway.
- In the Password field, enter the password returned from the PostgreSQL gateway.
- In the Encryption method field, select SSL. This ensures that the communication between ADF and CDF are encrypted.
- Optionally, select Validate server certificate.
- Select Test connection to make sure you are connected to the Azure database for PostgreSQL.
Create linked service
Step 4: Set the destination database table
Back on the Connection tab, you need to select the destination table from the tables available in your PostgreSQL gateway database. You can choose between several resource types like assets, events, and data points.Select destination table
public.<cdf_resource_type>, for instance, public.assets or public.time_series.
Step 5: Map the source and destination tables
Open Mapping tab
Import schemas
Map columns
Run debug

Step 6: Report run status for data extractions
Monitor the data integration into CDF to quickly catch failed runs to start troubleshooting and notify data set owners and stakeholders. You can see an overview of all extraction pipelines’ status on the Extraction pipelines page. To set up status reporting:Open Azure Data Factory
Add success activity

Configure success Copy data activity
Configure success Source tab
- Enter a source data set, but note that no data is read from this data set. You can, for instance, enter the data set already used in the previous pipeline.
- Create two additional columns named
integration_statuswith contentsuccessandintegration_external_idwith the extraction pipeline’s external ID as content.

Configure success Sink tab
- In the Sink dataset field, select New and reuse the sink and linked service from the previous pipeline.
- In the Table field, browse and select the foreign table
public.extraction_pipeline_runs.

Write method to Copy command.Configure success Mapping tab
- Row 1: Enter
integration_external_IDas source and theexternalIdas destination. - Row 2: Enter
integration_statusas source andstatusas destination.
Add failure activity
Configure failure Copy data activity
failure as content for the integration_statuscolumn.
Troubleshooting
Invalid token If you have a valid token but still getinvalid token when you create a user in the PostgreSQL gateway, try these solutions:
- The groups in Microsoft Entra ID and CDF are correctly linked in Manage & Configure > Access management in CDF. See step 3 above.
-
The CDF group is set up with the
Project:listandGroup:listcapabilities in Manage & Configure > Access management in CDF.