Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredJoin us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered
I have data source Azure Data Explorer kusto cluster and I need to connect to it in fabric notebook to read data by authenticating using workspace identity or SPN
How to authenticate using SPN when notebook is running under different identity
How to authenticate using workspace identity
Solved! Go to Solution.
I had this code worked
I had this code worked
Hi @SravyaNeela,
Thanks for sharing your working solution! please consider marking your reply as the Accepted Solution this helps highlight the resolution and can assist other community members who face similar challenges.
Thank you.
Hi @SravyaNeela,
We haven’t heard back from you regarding your issue. If it has been resolved, please mark the helpful response as the solution and give a ‘Kudos’ to assist others. If you still need support, let us know.
Thank you.
Hi @SravyaNeela,
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
Hi @SravyaNeela,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
Hi @SravyaNeela,
Thank you for reaching out to the Microsoft Fabric Forum Community.
Additionally, to the @burakkaragoz, helpful response, I found the following links useful and relevant to your issue they provide practical examples and documentation for connecting Fabric notebooks to Azure Data Explorer (Kusto) using both Service Principal and Managed Identity:
Querying KQL Database in Fabric Notebook Using Python SDK
Use Fabric notebooks with data from a KQL database - Microsoft Fabric | Microsoft Learn
If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.
Thank you.
Hi @SravyaNeela ,
Great question — integrating Azure Data Explorer (Kusto) with Microsoft Fabric Notebooks using secure authentication methods like Service Principal (SPN) or Workspace Managed Identity is a powerful pattern for enterprise-grade data access.
To authenticate using a Service Principal from a Fabric notebook:
from azure.kusto.data import KustoConnectionStringBuilder from azure.kusto.data.helpers import dataframe_from_result_table from azure.kusto.data import KustoClient cluster = "https://<your-cluster>.kusto.windows.net" client_id = "<your-app-id>" client_secret = "<your-app-secret>" tenant_id = "<your-tenant-id>" kcsb = KustoConnectionStringBuilder.with_aad_application_key_authentication( cluster, client_id, client_secret, tenant_id ) client = KustoClient(kcsb) query = "YourKustoDatabase | take 10" response = client.execute("<YourKustoDatabase>", query) df = dataframe_from_result_table(response.primary_results[0])
⚠️ Ensure the SPN has Data Reader permissions on the Kusto database and is registered in Azure AD.
If your Fabric workspace is configured with a Managed Identity, and your Kusto cluster supports Azure AD-based access, you can authenticate using:
from azure.identity import DefaultAzureCredential from azure.kusto.data import KustoClient, KustoConnectionStringBuilder cluster = "https://<your-cluster>.kusto.windows.net" credential = DefaultAzureCredential() kcsb = KustoConnectionStringBuilder.with_aad_device_authentication(cluster) client = KustoClient(kcsb)
Note: As of now, DefaultAzureCredential may not fully support Fabric’s managed identity context. If that’s the case, you may need to use Azure CLI login or interactive browser auth as a fallback during development.
Let me know if you’d like help setting up the Azure AD app registration or assigning permissions in Kusto!
User | Count |
---|---|
82 | |
42 | |
16 | |
11 | |
7 |
User | Count |
---|---|
92 | |
88 | |
27 | |
8 | |
8 |