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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
datakohai12
Frequent Visitor

Microsoft Fabric connect to Azure Key Vault

Greetings everyone, 

 

I am trying to establish a connection between my Microsoft Fabric notebook and an Azure KeyVault to access some secrets. Unfortunately, I am facing an issue with MSI while using Power BI, as it keeps timing out when trying to obtain a token. Any suggestions on how to resolve this issue would be greatly appreciated. Thank you.

3 ACCEPTED SOLUTIONS
GeethaT-MSFT
Community Support
Community Support

@datakohai12  Thanks for sharing the steps Fabric currently does not support managed identity authentication which is what this is trying to authenticate via.  Until that's fully integrated, there's a simple workaround.  As long as you are executing notebook has access to the vault, the below will work.  

from trident_token_library_wrapper import PyTridentTokenLibrary as tl

access_token = mssparkutils.credentials.getToken("keyvault")

tl.get_secret_with_token("https://vaultName.vault.azure.net/","secretName",access_token)

Regards

Geetha

 

View solution in original post

@datakohai12 It wouldn't be present in pypi

you should be able to execute that code directly in your Trident notebook if you're not able to send over a screenshot of the error.

 

Regards

Geetha

View solution in original post

Interesting is now working. Thanks.

View solution in original post

8 REPLIES 8
GeethaT-MSFT
Community Support
Community Support

@datakohai12  Thanks for sharing the steps Fabric currently does not support managed identity authentication which is what this is trying to authenticate via.  Until that's fully integrated, there's a simple workaround.  As long as you are executing notebook has access to the vault, the below will work.  

from trident_token_library_wrapper import PyTridentTokenLibrary as tl

access_token = mssparkutils.credentials.getToken("keyvault")

tl.get_secret_with_token("https://vaultName.vault.azure.net/","secretName",access_token)

Regards

Geetha

 

@GeethaT-MSFT 

I have used the above code to mount the data lake gen2 using notebook in microsoft fabric and getting below error - An error occurred while calling o4394.getSecretWithToken. : java.io.IOException: 401 {"error":{"code":"UnauCapture.PNGthorized","message":"AKV10032: Invalid issuer.

 

 

 

Hi Geetha,

I apologize for the delayed response. Thanks for the workaround; I am using it now, though I am having trouble finding trident_token_library_wrapper. Could you direct me to it in PyPi?

@datakohai12 It wouldn't be present in pypi

you should be able to execute that code directly in your Trident notebook if you're not able to send over a screenshot of the error.

 

Regards

Geetha

Interesting is now working. Thanks.

Good to hear that it is now working for you,
Thanks for visiting Fabric Community have a great day!

 

Regards

Geetha

GeethaT-MSFT
Community Support
Community Support

Hi @datakohai12 Thanks for posting your question in Microsoft Fabric Community

Can you please share the steps you have followed or any screenshot of the error.

Regards

Geetha

Hi,

The following are my steps:

  1. Created a Synapse Data Engineering Notebook
  2. Granted the Power BI Service Account Get permissions via Access Policy in the Azure Key Vault

Here is a screenshot of the code and the error message:

datakohai12_0-1687793837978.png

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Expanding the Synapse Forums

New forum boards available in Synapse

Ask questions in Data Engineering, Data Science, Data Warehouse and General Discussion.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.