Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join 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

Reply
victorha
Frequent Visitor

Get Linked service token in Microsoft Fabric notebook

In synapse, I can add the Azure SQL Server service credentials into the settings and then access it from a notebook:

access_token = mssparkutils.credentials.getConnectionStringOrCreds('SQLProdLinkedService')

 

How can I do the same in Fabric?

5 REPLIES 5
v-cboorla-msft
Microsoft Employee
Microsoft Employee

Hi @victorha 

 

Thanks for using Microsoft Fabric Community.

Please refer to the following documentation on access token in Microsoft Fabric Notebook.

Link 1 : Reading and Writing Secrets in Azure Key Vault Using Microsoft Fabric Notebooks

Link 2 : Handling secrets in Fabric Notebooks - Azure Key Vault (youtube.com)

 

I hope this information helps. Please do let us know if you have any further questions.

 

Thank you.

Hi @v-cboorla-msft

 

Sorry I didn't specify before. In synapse, I connected an Azure SQL Database using a System Assigned Managed Identity and then I fetched the token directly through the credential utils.

Can I do something similar in Fabric?

 

If the same is not possible, what is the safest alternative?

Hi @victorha 

 

Apologies for the delay in response from my end.

 

Here are two methods on how to read and write secrets from within a notebook using the API as well as Fabric MSSPARKUTILS package. The Azure Key Vault API has been around for a while and is a very stable way of communicating with Azure Key Vault and is currently the best way to do so. 

 

MSSPARKUTILS for Fabric makes the process significantly easier, BUT it currently does not have all the necessary functionality to accommodate writing secrets to Key Vault. Although the package lacks those capabilities, I believe it will soon have them as the Azure Synapse version of the package contains those abilities, so it will be just a matter of when and not if.

 

For additional information, please refer to the below documentation : 

Link 1 : Reading and Writing Secrets in Azure Key Vault Using Microsoft Fabric Notebooks.         

Link 2:  Handling secrets in Fabric Notebooks - Azure Key Vault (youtube.com)

 

I hope this information helps. If you have any further details please do let us know.

 

Thank you.

Hi @victorha 


We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. In case if you have any resolution please do share that same with the community as it can be helpful to others.
Otherwise, will respond back with the more details and we will try to help.

 

Thanks.

Hi @victorha 

 

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. In case if you have any resolution please do share that same with the community as it can be helpful to others .
If you have any question relating to the current thread, please do let us know and we will try out best to help you.
In case if you have any other question on a different issue, we request you to open a new thread.

 

Thanks.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.