Forum Discussion
API secrets without Azure Key Vault
- 6 months ago
Hello LW07
There's a Preview feature using which you can create a connection using a client_id and secret and use the connection in your notebook. In this way your client_id and secret are always protected.
Here's a link to the Microsoft doc which shows how to use this feature.
Fabric Connection with Notebook - Microsoft Fabric | Microsoft Learn
- 6 months ago
Hi LW07 ,
you have two options for reading a secret from a Key Vault.
Option 1:
As already described by deborshi_nag , you use the Fabric Connection with Notebook. However, this is still in preview. You also need permissions on the Key Vault to read it.
Option 2:
You use code to read the data from a Key Vault. The administrator of your organization must also assign you the role “Key Vault Secrets User.” Then you can read the secrets.
Here an Example to read from with python. In my example, I define a few parameters in the notebook beforehand. You don't necessarily need them.
import requests app_client_id = mssparkutils.credentials.getSecret(f"https://{key_vault_name}.vault.azure.net/", kvclientid_1)For security reasons, I advise against writing secrets in plain text anywhere. If possible, you should always use a key vault.
I hope this helps.
Best regards.
Rene
Feel free to leave kudos or accept it as a solution. This will also help other community members.
- 5 months ago
There aren't really any good solutions that don't involve invoking assistance from other members of staff who have Azure responsibilities. So I don't think my question is resolved in the format I would prefer it, but I appreciate the responses from everyone. Many thanks.
Thanks for the options, deborshi_nag unfortunately it's OAuth2 I need to use which isn't supported as per the document you sent.
Fran-Diaz I will use a file in the lakehouse for now I think.