Forum Discussion
Hide password in Notebook
- 1 year ago
Hi tan_thiamhuat , Thank you for reaching out to the Microsoft Community Forum.
As of May 2025, Fabric Notebooks don’t offer native cell-hiding or built-in secret management like Azure Key Vault. You can store your credentials in a JSON file within OneLake or a Lakehouse. You can then load the credentials in your notebook at runtime. To keep this secure, use Fabric’s role-based access control (RBAC) to restrict access to the folder containing the file. OneLake encrypts data at rest by default and RBAC ensures only authorized users can access the sensitive file. This keeps passwords out of your notebook code and lets you automate processes without exposing secrets. Just be sure not to log or print the credentials in notebook output and avoid committing this file to any version-controlled repositories.
For development or one-off interactive tasks, a simpler option is to use Python’s getpass module to prompt the user to enter the password at runtime. This way, no password is stored in code or files, reducing the risk of accidental exposure. It’s ideal when you're running a notebook manually and don’t need automation.
If this helped solve the issue, please consider marking it 'Accept as Solution' so others with similar queries may find it more easily. If not, please share the details, always happy to help.
Thank you.
thanks for your reply. How about for customers who do not have the Azure account?
Hi tan_thiamhuat , Thank you for reaching out to the Microsoft Community Forum.
As of May 2025, Fabric Notebooks don’t offer native cell-hiding or built-in secret management like Azure Key Vault. You can store your credentials in a JSON file within OneLake or a Lakehouse. You can then load the credentials in your notebook at runtime. To keep this secure, use Fabric’s role-based access control (RBAC) to restrict access to the folder containing the file. OneLake encrypts data at rest by default and RBAC ensures only authorized users can access the sensitive file. This keeps passwords out of your notebook code and lets you automate processes without exposing secrets. Just be sure not to log or print the credentials in notebook output and avoid committing this file to any version-controlled repositories.
For development or one-off interactive tasks, a simpler option is to use Python’s getpass module to prompt the user to enter the password at runtime. This way, no password is stored in code or files, reducing the risk of accidental exposure. It’s ideal when you're running a notebook manually and don’t need automation.
If this helped solve the issue, please consider marking it 'Accept as Solution' so others with similar queries may find it more easily. If not, please share the details, always happy to help.
Thank you.