Forum Discussion
Connecting to Azure SQL Server from a Fabric Compute Notebook using Managed Identity
- Anonymous1 year ago
Hi hkaushik ,
I want to personally thank nilendraFabric for your active participation and the valuable solutions you have shared in the community forum. Your contributions truly make a significant impact.
Thank you for trying the provided approach. Since it did not resolve the issue, I kindly recommend raising a support ticket. This will enable a dedicated team to investigate and provide you with a resolution.To raise a support ticket for Fabric and Power BI, kindly follow the steps outlined in the following guide:
How to create a Fabric and Power BI Support ticket - Power BI | Microsoft Learn
If this post helps, please give us Kudos and consider marking it Accept as solution to assist other members in finding it more easily.
Thank you for being a part of Microsoft Fabric Community Forum!
Thanks,
Pallavi G.
Hello hkaushik
Workspace Identity is the most reliable option currently, as full support for Managed Identities in Fabric notebooks is limited.
When using Workspace Identity with Azure SQL Database, you don’t need to manually retrieve or pass additional tokens if the environment is properly configured. Instead, you need to grant the Workspace Identity access rights on the database itself.
connection_string = (
"Driver={ODBC Driver 18 for SQL Server};"
f"Server={server_name};"
f"Database={database_name};"
"Authentication=ActiveDirectoryMSI;"
"TrustServerCertificate=yes;"
)
Just fyi.
When using libraries like `mssparkutils` or `notebookutils` to retrieve tokens, these often return the user’s personal token instead of the Workspace Identity token.
is this is helpful please accept the solution
Hi nilendraFabric ,
I had tried that earlier too. It gives error:
Though, I am able to connect via pipeline which means there should be no access issue.