Forum Discussion
Azure Key Vault References
- 1 year ago
Hi onerbreno
If your Fabric notebook isn't fetching secrets with mssparkutils.credentials.getSecret(), here are a few troubleshooting stesps to look out for:
- Make sure your Fabric workspace's managed identity has both the Key Vault Reader and Key Vault Secrets User roles assigned in Azure Key Vault's "Access Control (IAM)".
- Verify the Key Vault name and secret name in your code — they are case-sensitive. Even minor typos can cause silent failures.
- Check that the secret is active — not disabled or expired.
- If your Key Vault uses private endpoints or has public access fully disabled, Fabric won’t be able to reach it. Fabric currently doesn’t support connecting to Key Vaults through private endpoints.
- This code will only work inside a Fabric notebook — it won’t function in an external IDE or local script.
- To confirm which identity your notebook is using to call the Key Vault, run:
from notebookutils import mssparkutils
print(mssparkutils.credentials.getIdentityName()
Let me know if you need help checking any of these or interpreting what you find!
Note:For refrence check the below link for supported connectors and authentication types.
Azure Key Vault Reference overview (Preview) - Microsoft Fabric | Microsoft Learn
FYIIf the above information is helpful, please give us Kudos and mark the response as Accepted as solution.
Best Regards,
Community Support Team _ C Srikanth.
Hi willparker1
You're right, mssparkutils is deprecated in Microsoft Fabric. The supported way to access Azure Key Vault secrets in Fabric is by using mssparkutils inside Fabric notebooks only:
from notebookutils import mssparkutils
secret = mssparkutils.credentials.getSecret("YourKeyVaultName", "YourSecretName")
This works only inside Fabric notebooks, not in standalone Python scripts. Make sure your Fabric workspace identity has access to the Key Vault with the "Key Vault Secrets User" role. No need to store usernames or passwords manually. For external Python scripts, use Azure SDK instead.
If the above information helps you, please give us a Kudos and marked the Accept as a solution.
Best Regards,
Community Support Team _ C Srikanth.