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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Community Support
Community Support

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.