The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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.
Solved! Go to Solution.
@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
@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
@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
Hi! How do we give the executing notebook as access to the key vault?
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":"Unauthorized","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
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:
Here is a screenshot of the code and the error message:
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Data Engineering, Data Science, Data Warehouse and General Discussion.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
6 | |
5 | |
4 | |
3 | |
2 |