The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
User | Count |
---|---|
19 | |
18 | |
7 | |
3 | |
3 |
User | Count |
---|---|
51 | |
30 | |
14 | |
9 | |
6 |