Forum Discussion
Avoiding including Snowflake credentials in Python script when python script uses Snowflake
- 1 year ago
Hi. Power Bi has snowflake connector. You should use them to let powerbi keep the credentials encrypted and secured. Then you can run a python step at Query Editor (Transform Data) to keep going if you prefer transforming data that way.
I hope that helps,
Hi david_busint,
Thank you for reaching out to the Microsoft Fabric Community Forum.
Thank you for raising your concern. We really apologize for the inconvenience caused. After reviewing the details you provided, please follow the steps below, which might resolve the issue.
- Store your Snowflake credentials in environment variables to avoid hardcoding them in your script. Use a configuration file for your credentials and ensure it's excluded from version control by adding it to .gitignore.
- Use key pair authentication instead of username and password for better security and to avoid storing passwords.
- Utilize secrets management services like aws secrets manager, azure key vault, or Hashi corp vault to securely store and retrieve your credentials.
- Snowflake now allows managing secrets directly within the platform, enabling secure storage of sensitive information like API keys or passwords.
By implementing these methods, you can ensure that your Snowflake credentials are handled securely and not exposed within your Python scripts.
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.
Best Regards.