Forum Discussion
John_L_Edwards
Advocate III
3 years agoReverting from Prod back to Dev, when you have Data Source Rules
We are just getting our feet under us, and have figured out how to have Dev point to Dev sources, Prod point to Prod sources by using Deployment Rules in the Deployment Pipeline. But when we tried t...
Bipin-Lala
Solution Sage
4 months agoHi John_L_Edwards,
When you do a Backward Deployment i.e. moving an item from Prod back to Dev, Power BI copies the dataset file exactly as it exists in Production. Because Deployment Rules only apply forward (when deploying into a stage that has rules defined), the target Dev workspace doesn't have an incoming rule to intercept the file and rewrite the connection strings.
As a result, your Dev dataset gets overwritten with your hardcoded Production connection strings.
To go about this, you can -
Parametrize Connections in Power Query (The Enterprise Standard)
If you aren't already using Power Query parameters for your server and database names, implementing them eliminates this problem entirely.
- In Power BI Desktop, create two text parameters: ServerName and DatabaseName.
- Update your data source steps to look like: Sql.Database(#"ServerName", #"DatabaseName").
- When you set up your Deployment Pipeline rules, use Parameter Rules instead of Data Source Rules.
Let me know how this goes for you!