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

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Help With SQL Sources and Environment Variables

(0) ShareShare
ReportReport
Posted on by 29
I've spent the last 2 days trying to get this to work but keep running into the same error. I'm trying to deploy a solution from a DEV environment to TEST environment as a managed solution.
 
I've created variables for the connection, the server, the database and also tried a table variable as well. I set them all not to export the value.

When I import the solution, I add the new server, database and table. But once it's imported, I can see the server and database have changed, but the table still points to the old table reference and doesn't use the new one during import.
 
Is there a workaround to make this work, or am I doing something wrong.
 
I even tried starting again with a new unmanaged solution, creating a new app, connections and variables, adding the SQL datasource to the app using the new variables, and exporting as a managed solution. But still the issue persists. The imported solution holds onto the old table reference and doesn't using the new one that's added during import.
Categories:
I have the same question (0)
  • MS.Ragavendar Profile Picture
    4,109 Super User 2025 Season 2 on at
    Help With SQL Sources and Environment Variables
     
    I believe you have created the 2 environment variables for the SQL.
     
    First you create an environment variable for your server. Once that is created you can create an environment variable for the database that attaches to the server environment variable.
     
     
     
    Please click Accept as solution if my post helped you solve your issue and help others who will face the similar issue in future.
    ❤️ Please consider giving it a Like, If the approach was useful in other ways.
    🏷️ Please tag me @MS.Ragavendar if you still have any queries related to the solution or issue persists.
  • russellhq1 Profile Picture
    29 on at
    Help With SQL Sources and Environment Variables
    That's right. I created the variable for the server. Then, when creating the variable for the database, I referenced the server variable.
  • developerAJ Profile Picture
    4,025 on at
    Help With SQL Sources and Environment Variables
    it was supposed to be made general availability but not yet made, this does not work it's a pain but for now only way you can manage it is opening app in your Test or prod and reconnecting it using the same environment variable again. it creates an unmanaged layer but that's the only workaround available now.
     

    If this solution helped you resolve your issue, kindly mark it as accepted — it makes it easier for others to find and also closes the discussion. If you found it useful, a Like ❤️ would be greatly appreciated!

    🤝 Let’s connect on LinkedIn 

    📘 Explore more on my articles

    🐱‍💻 Github Link

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Tom Macfarlan – Community Spotlight

We are honored to recognize Tom Macfarlan as our Community Spotlight for October…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 829 Most Valuable Professional

#2
developerAJ Profile Picture

developerAJ 570

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 403 Super User 2025 Season 2

Last 30 days Overall leaderboard