Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered
I have a notebook in my DEV workspace. The notebook contains parameters that reference the API DEV link and the acces token.
I want to deploy this notebook int the PROD workspace and dynamically change the credentials so that it fetches the API PROD credentials.
It doesn't work with "deployment pipeline" feature in Fabric.
How can i achieve this differently? Anyone has an idea?
Solved! Go to Solution.
Hi @Stevek-09
It sounds like you need a way to dynamically switch between DEV and PROD credentials when deploying your notebook. Here is my workaround you could consider:
1. Create a configuration file (e.g., config.json) that contains the paths for both DEV and PROD auth URLs. This file can be stored in the notebook's source directory or in a shared location accessible by the notebook.
2. In your notebook, use the sempy
library to determine which workspace the notebook is running in. This determines which set of credentials to use.
3. Read the configuration file and get the correct set of credentials. Use the credentials for authentication. Then execute the subsequent codes.
Here is my example:
With this approach, when running the notebook, it will identify whether it's in DEV workspace or PROD workspace first. Then get the appropriate set of credentials to be used in the notebook. You don't have to modify the credentials during the deployment process. You can also store credentials in other places like Azure Key Vault. Then use a similar logic to get the correct credentials after identifying the workspace.
Hope this would be helpful.
Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!
Hi @Stevek-09
It sounds like you need a way to dynamically switch between DEV and PROD credentials when deploying your notebook. Here is my workaround you could consider:
1. Create a configuration file (e.g., config.json) that contains the paths for both DEV and PROD auth URLs. This file can be stored in the notebook's source directory or in a shared location accessible by the notebook.
2. In your notebook, use the sempy
library to determine which workspace the notebook is running in. This determines which set of credentials to use.
3. Read the configuration file and get the correct set of credentials. Use the credentials for authentication. Then execute the subsequent codes.
Here is my example:
With this approach, when running the notebook, it will identify whether it's in DEV workspace or PROD workspace first. Then get the appropriate set of credentials to be used in the notebook. You don't have to modify the credentials during the deployment process. You can also store credentials in other places like Azure Key Vault. Then use a similar logic to get the correct credentials after identifying the workspace.
Hope this would be helpful.
Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!
Hi @Anonymous thank you. It sounds OK for me.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Fabric update to learn about new features.
User | Count |
---|---|
69 | |
39 | |
15 | |
14 | |
5 |
User | Count |
---|---|
72 | |
65 | |
25 | |
8 | |
7 |