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 / Issue with SQL Connect...
Power Apps
Suggested Answer

Issue with SQL Connection Reference Switching Incorrectly During Pipeline Deployment

(0) ShareShare
ReportReport
Posted on by 11

I am facing an issue with SQL connection references while deploying a Canvas App through Power Platform Pipelines.

I have two SQL connections configured in Power Apps:

  • SP-SQL
  • Digital-NPD

In the Sandbox environment, the app is explicitly connected to Digital-NPD via a connection reference. I then deploy the solution to the Test environment using a pipeline.

During the pipeline deployment, the connection reference mapping screen shows that the app is correctly mapped to Digital-NPD. Both SQL connections (SP-SQL and Digital-NPD) are already created manually in their respective environments

However, after deployment, when I open the app in Play mode in the Test environment, the app connects to SP-SQL instead of Digital-NPD. This happens even though the connection reference mapping during deployment is correct

  • The Test environment is managed
  • Making any manual fixes creates an unmanaged layer, which we want to avoid
  • Rebinding the connection inside the app is therefore not an option
 
Why does Power Apps bind to the wrong SQL connection at runtime even though the pipeline mapping is correct?
 
How can SQL connections or connection references be reliably pushed and enforced between environments using pipelines?
 
Is there a supported way to prevent Power Apps from auto-resolving to an incorrect SQL connection when multiple compatible connections exist in a managed environment?
 

Any guidance on the correct architectural or deployment approach to handle this scenario would be appreciated.

I have the same question (1)
  • Suggested answer
    sannavajjala87 Profile Picture
    515 Super User 2026 Season 1 on at
    Hi,
     
    This is a known canvas-app quirk, not a pipeline bug. Flows bind strictly to the connection reference, but canvas apps don't. At play time the app resolves its SQL data source by matching auth, server, and database, and when more than one compatible connection exists, it just grabs the oldest match regardless of what the pipeline mapping showed. So your mapping to Digital-NPD is correct, but the app ignores it and lands on SP-SQL because that connection also matches and is older.

    That's also why rebinding in the app fixes it, and why it creates the unmanaged layer you're avoiding. You're forcing the choice by hand.
     
    The real fix is to remove the ambiguity in the target environment, not touch the app. Keep one SQL connection per connection reference, and don't leave two compatible SQL connections sitting in the same managed environment. If Test only has Digital-NPD, the app has nothing else to resolve to and binds correctly every time. If SP-SQL has to exist there for another app, isolate it in a different environment or make sure it points to a genuinely different server or database so the app can't treat them as interchangeable.

    One thing to check in Sandbox before redeploying: make sure the app's data source is wired to the connection reference and not a direct connection baked into the app. If it's direct, the pipeline mapping has nothing to enforce.

    Short version: canvas apps auto-pick the oldest matching SQL connection and the pipeline can't override that, so the fix is making sure only the intended connection exists in the target environment.
    Hope that helps.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard