cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SidhharthM
Regular Visitor

Change Power Apps SQL data connection while moving from dev to production

Hi Everyone,

 

I have below SQL server environments (Not the Power Apps environment):

 

Dev Environment: Server A -> '[DevDBName].[SourceTableName]'

Pre-Prod Environment: Server A -> '[ProdDBName].[SourceTableName]'

Prod Environment: Server B-> '[ProdDBName].[SourceTableName]'

 

If you observer above,

1. Table name SourceTableName and its schema is same in all environments. 
2. Dev and Pre-Prod reside in same Server A and Prod is in different Server B.

3. Both Pre-Prod and Prod have same DB name ProdDBName.

 

Below is what I am currently doing:

1. When I migrate Power Apps from Dev to Pre-Prod, I have to visit each formula in Power Apps and change the DB Name.

2. I am yet to plan for migration of Power Apps from Pre-Prod to Prod and yet to decide on keeping both the Power Apps on same power apps environment or keep them in separate environment.

 

Below are my queries:

1. What is the best possible way to avoid manual db name change in all the formulas from DevDBName to ProdDBName?

2. If I move from Pre-Prod to Prod, and if they are in same Power Apps environment, do I still have to go everywhere and change it manually as both db names are same?

3. If I plan to keep Pre-Prod and Prod in different Power Apps environment,  do I still have to go everywhere and change it manually as both db names are same?

 

Thanks in Advance,

Sidhharth M.

 

4 REPLIES 4
edguerre
Microsoft
Microsoft

@SidhharthM : I hope I understood this correctly, if not please rephrase the question if possible.

Even though the DB and table names and schemas are the same, you might need to manually select the new connection. This is because it does not only go by name, but by ID as well.

 

1. You could export the app as a package and edit the JSON, but this might break the app and is unsupported.

 For 2 and 3, my opinion is that you might have to change any connection/selection that points at a different location than where the original app pointed.

 @edguerre Thanks for the input. Yes, of course we need to change the connection when connecting to different data source. But my main issue is manually going everywhere in Power Apps formulas and changing db name. Is there any better approach for this?

PS: I have tried changing db name in json file,  but still I had to change the db name manually everywhere.

 

WoLe98
Frequent Visitor

Is there any update on this? manually updating every time there is an update seems a bit frustrating?

SidhharthM
Regular Visitor

Well, there is a way, especially when we use Data verse or SharePoint. We can use Solutions for migrating from one environment to other, all the db tables get automatically created:

SidhharthM_0-1634189847195.png

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,412)