web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Environment variable w...
Power Apps
Unanswered

Environment variable with SQL server

(3) ShareShare
ReportReport
Posted on by 10

Im using  SQL Server connector with different databases for Dev, Uat, and prod.

My question is how to change these data source while deploying it from one environment to another?

I checked environment variable but i could see only sharepoint, dataverse, SAP ERP options.

I couldn't see SQL server there,

So please help me to achieve this. How to change data source in different environment.

 

Thanks in Advance

 

emil049_0-1683027491379.png

 

  • joe_hannes_col Profile Picture
    1,843 Super User 2024 Season 1 on at

    Hello @emil049,

     

    With SQL, you might not need environment variables when working with solutions. When you import a solution into Prod, you should be asked to specify a connection to SQL. Depending on the type of authentication you use, you will be asked to specify the server URL at this point, e.g. when using SQL username/password.

    If your tables have the same names, your apps and flows should work.

  • hongkong Profile Picture
    277 on at

    I have a test Power App connected to SQL server with authentication AAD - Universal with MFA. It is pointing to a Test SQL server.

    When I export the solution and import to the production environment, no prompt up ask me for server name, login, etc. Therefore, with a managed solution, I have no way to update the SQL server connection to a production one.

     

    What should we do for above scenario beside using a unmanaged solution? 

  • arigold Profile Picture
    4 on at

    I'm struggling with the same challenge. Did you progress with any solution or workaround for environmental variables for SQL Server?

  • emil049 Profile Picture
    10 on at

    Not yet,

    currently im changing the data source in the test environment, and export the app to prod.

  • hanzelmans Profile Picture
    on at

    What was the end result?  I'm running into the same problem when I try to promote a solution between environments.

     

    Do you modify the app in the next level environment (dev to test)?  Since Test or Prod would be managed, you kind of "break" the solution by doing that.

  • velegandla Profile Picture
    204 Moderator on at

     @hanzelmans'

     

    Can you try below steps using Power platform pipelines?

     

    1. Deleted all old Solutions on Development environment.
    2. Deleted all Connection references.
    3. Created new Solution in development environment.
    4. Add the existing Canvas App to the solution. 
    5. Added new connection reference to SQL server connection.
    6. Deleted all Datasets(Tables) inside Canvas App which used the SQL Server connection.
    7. Added the Dataset(Tables) again with for SQL Server connection.
    8. Deploy the solution using Pipeline.

      ====================================================

      If I have answered your question, please mark your post as Solved.
      If you like my response, please give it a Thumbs Up.

      https://www.linkedin.com/in/devendravelegandla/ 

     

  • hongkong Profile Picture
    277 on at

    May I know which type of SQL server connection you're using? I believe only SQL authentication can be used in connection reference?

     

    In Step 6 and 7, do you mean delete and re-add the "data connection" listed in below screen capture ?

    hongkong_0-1710493858296.png

     

  • velegandla Profile Picture
    204 Moderator on at

    @hongkong 

     

    That is correct.

     

     

  • hanzelmans Profile Picture
    on at

    What if I do not have pipelines configured?

     

    Would a normal solution import/export do the trick?

  • velegandla Profile Picture
    204 Moderator on at

    @hanzelmans 

     

    I believe so; normal export and import should work similarly.

     

    ====================================================

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

    https://www.linkedin.com/in/devendravelegandla/ 

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 337 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 250

#3
Mohsin Ali Profile Picture

Mohsin Ali 225

Last 30 days Overall leaderboard