Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join 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

Reply
Stevek-09
Frequent Visitor

Changing the path in my notebook in a deployment pipeline

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?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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:

vjingzhanmsft_0-1734490466693.png

 

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!

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

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:

vjingzhanmsft_0-1734490466693.png

 

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.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June FBC25 Carousel

Fabric Monthly Update - June 2025

Check out the June 2025 Fabric update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.