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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Amik_singh
Advocate I
Advocate I

Database with change in pipeline

we use Deployment Pipelines (Dev , Test , Prod). Every time I deploy from Dev to Test, the data source resets to the 'Dev' database, and I have to manually update the credentials and server names in the Service. Is there a way to make the Service 'remember' that the Test workspace should always point to the Test database?

1 ACCEPTED SOLUTION
Amar_Kumar
Super User
Super User

Hello @Amik_singh The Solution is Deployment Rules

Service has a built-in feature Deployment Rules that acts as a "find and replace" during the deployment process.
​Step 1: Parameterize your Desktop Report
​Before publishing, ensure your Server and Database names are Parameters in Power Query: ​In Power BI Desktop, go to Transform Data > Manage Parameters.
​Create a parameter called pServerName.
​Use this parameter in your Source step: Sql.Database(pServerName, "MyDatabase").
​Step 2: Configure the Rule in the Service
​Go to your Deployment Pipeline in the Power BI Service.
​Click on the Deployment Rules icon (the lightning bolt) between the stages (e.g., between Dev and Test).
​Select the Semantic Model you are deploying.
​Go to the Parameters tab.
​Set a rule: When deploying to Test, change pServerName to test-sql-server.database.windows.net.
​Step 3: Set and Forget
​Now, every time you click "Deploy," Power BI will automatically swap the Dev values for Test values. Your production data remains secure and untouched, and you never have to manually edit connection strings again.

 

please marke it a solution if it helps.

View solution in original post

2 REPLIES 2
Amar_Kumar
Super User
Super User

Hello @Amik_singh The Solution is Deployment Rules

Service has a built-in feature Deployment Rules that acts as a "find and replace" during the deployment process.
​Step 1: Parameterize your Desktop Report
​Before publishing, ensure your Server and Database names are Parameters in Power Query: ​In Power BI Desktop, go to Transform Data > Manage Parameters.
​Create a parameter called pServerName.
​Use this parameter in your Source step: Sql.Database(pServerName, "MyDatabase").
​Step 2: Configure the Rule in the Service
​Go to your Deployment Pipeline in the Power BI Service.
​Click on the Deployment Rules icon (the lightning bolt) between the stages (e.g., between Dev and Test).
​Select the Semantic Model you are deploying.
​Go to the Parameters tab.
​Set a rule: When deploying to Test, change pServerName to test-sql-server.database.windows.net.
​Step 3: Set and Forget
​Now, every time you click "Deploy," Power BI will automatically swap the Dev values for Test values. Your production data remains secure and untouched, and you never have to manually edit connection strings again.

 

please marke it a solution if it helps.

Thanks for helping.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.