Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Data connection retained by APP after IMPORT.

Apologies if this has been answered before - I have searched but maybe just didn't get the correct terminology.


I have an APP connected to an On-Prem SQL Server via the Data Gateway. I have exported the app from Environment-A and then imported the package to Environment-B. The APP imports with no problems but I see a lot of errors related to the data connector. The error is : "You don't have permission to view ... sql view/table x". When I attempt to Refresh the connections, they fail with this same error. I then noticed that the connector is pointing to the data source used in Environment A.


During Import you are forced to, either choose between an SQL Connector that already exists in the new Environment OR to create a new SQL connector at import time. No matter which of those I try to import with I get the same results.


So to summarise all of my connections indicate they are attempting to connect to the data source from Environment A. But if I add a new connection (which is using the Environment B connector) it DOES connect to the data base I intend and the connection works as expected. Anyone experienced similar and found a way to force the existing connections to use the "new" Environment connector ?









Community Support
Community Support


When you import the package, you will be able to choose the SQL connection.

Please ensure the connection you choose should be from the same gateway with the previous one.



In answet to v-silky-msft .


My understanding is that the Data Gateway doesn't specify an actual server/database just the means to connect to it. The actual server/database instance is configured in Data-->Connection which utilises the Data Gateway. In my case I want to choose between a DEV and PROD SQL instance on the same SQL server depending on which PowerApps environment the APP is built on.


To answer your question though, I only have a single Data Gateway configured - so yes I am using the same one.





Frequent Visitor

Just to clarify. This has not been solved. I have re-installed the data gateway with a different name and pointed my SQL data connection to this gateway. I confirmed the APP was reading and writing to the expected SQL server. I then repeated the Export --> Import with the same results as before i.e. all data connections displayed the Permission error I experienced previously with the error message referencing the old environment details. Adding a new connection works as expected so nothing wrong with the SQL data connection or the data gateway. The problem lies in the Export/Import process where the link to the old data connection is not being replaced with the new data connection selected as part of the Import process. To work around this I had to delete all connections and then re-add them and that, to me, is NOT ACCEPTABLE because it is prone to error. To me if the the intent of the Export --> Import process is that I should be able to use different SQL server source/destinations in different Environments via the Export/Import then it isn't working. Can anyone clarify how Micosoft intend  this to work? Has anyone else run into this issue ?

Frequent Visitor

We are experiencing the exact same issue but we are connecting to an Azure SQL database; which doesn't need a gateway.  When we export from environment A and import into environment B, during the import we select the SQL data connector for environment B.  Once the import is completed, all the SQL connections are broken.  A refresh doesn't fix them.  We then have to remove all the SQL connections and manually re-add them.

Helpful resources

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (3,071)