Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
spogula
Contributor
Contributor

How to connect Qlik to Azure Synapse link Database with modern authentication

 
Labels (1)
1 Reply
diegozecchini
Creator
Creator

found this guide, please try:

 

# Step 1: Prepare Azure Synapse Environment

1. Azure Synapse Workspace and Database: Ensure you have an Azure Synapse Analytics workspace and a dedicated SQL pool (formerly known as SQL Data Warehouse) where your data is stored.

2. Service Principal (App Registration)
- In Azure Active Directory (AAD), register a new application. This will create a Service Principal.
- Note down the **Application (client) ID**, **Directory (tenant) ID**, and **Client Secret** (you will need these for authentication).

3. Grant Permissions
- Assign the Service Principal to the SQL role on the Synapse database with appropriate permissions.
- For example, execute the following SQL command on your Synapse SQL pool:

```sql
CREATE USER [YourAppName] FROM EXTERNAL PROVIDER;
ALTER ROLE db_datareader ADD MEMBER [YourAppName];
```

4. Configure Azure Synapse
- Ensure that Azure Synapse is set up to allow access through the registered application. Verify that the Service Principal has permissions to access the Synapse workspace.

# Step 2: Install and Configure Qlik

1. **Install Qlik Sense**:
- Ensure you have Qlik Sense installed in your environment.

2. **Download and Install ODBC Driver for SQL Server**:
- Install the Microsoft ODBC Driver for SQL Server on the machine where Qlik Sense is installed. This driver supports Azure Synapse.

3. **Create an ODBC Data Source**:
- Open **ODBC Data Source Administrator** on your Qlik server.
- Create a new DSN (Data Source Name) with the following details:
- **Driver**: SQL Server
- **Server**: The fully qualified domain name (FQDN) of your Synapse SQL pool.
- **Authentication**: Set it to "Azure Active Directory - Service Principal".
- **Client ID**: The Application (client) ID of your registered application.
- **Client Secret**: The Client Secret generated during the app registration.
- **Tenant ID**: The Directory (tenant) ID from AAD.

4. Test the Connection
- Use the DSN to test the connection. Ensure that it connects successfully to Azure Synapse.

# Step 3: Connect Qlik to Azure Synapse

1. Open Qlik Sense
- Go to the Qlik Sense Hub.

2. Create a New App
- Create a new app or use an existing one.

3. **Add a Data Connection**:
- Go to the **Data Load Editor**.
- Select **Create New Connection** > **ODBC**.
- Choose the DSN you created earlier for the Azure Synapse connection.
- Test the connection within Qlik Sense.

4. Load Data
- Once the connection is established, you can select tables and views from Azure Synapse.
- Load the desired data into your Qlik app.

# Step 4: Configure Data Load Scripts (Optional)

- Depending on your needs, you can customize your data load scripts in Qlik Sense to pull specific data or perform transformations.

# Troubleshooting Tips:

- Firewall Settings: Ensure that your Qlik server can reach the Azure Synapse SQL pool over the internet. Check firewall rules in both Azure and your local network.
- ODBC Errors: If you encounter ODBC errors, double-check the credentials and permissions assigned to the Service Principal.