Forum Discussion

cstoddard's avatar
cstoddard
Frequent Visitor
1 year ago
Solved

How to store secrets/access secrets using User Data Functions

Hi,   I'm intersted in using the new User Data Function functionality, but I don't see any way to store secrets securly (think an API key, etc). How can I do so?
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi cstoddard 
    Thank you for posting in the Microsoft Fabric Community. Also thankyou lbendlin  for your inputs.

     

    To securely store and access secrets within User Data Functions (UDFs) in Microsoft Fabric, the best approach is to integrate Azure Key Vault (AKV) with Managed Identities. This ensures that sensitive information, such as API keys, is never hardcoded in your UDFs.

    First, enable Managed Identity for your Fabric workspace, then grant it the "Key Vault Secrets User" role in AKV. This allows Fabric to authenticate securely and retrieve secrets without needing to store credentials in code.

    If Managed Identities are not available in your setup, an alternative is using environment variables to securely store authentication details. Avoid hardcoding secrets at all costs, as it poses security risks.

    For detailed guidance on securing credentials in Microsoft Fabric, refer to Microsoft Docs on Fabric Security. This approach follows security best practices and ensures your API keys and other sensitive data remain protected.

     

    If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.

     

    Thankyou.

  • R1k91's avatar
    R1k91
    7 months ago

    AKV support added and announced at Ignite 2025.

    I blogged about it here.