Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Unanswered

ALM : SQL Server AAD : change server name and database name for SQL Server AAD across environment

(1) ShareShare
ReportReport
Posted on by 55

Hello,

 

I'm trying to replace the direct SQL Server connector with SQL Server AAD connector for my canvas apps and flows regrouped in differents solutions.

 

As this new connector doesn't save the server name and database name in itself, exporting canvas app and flow to the production environment doesn't change the server and database used. And if a different server and database was specified in the production environment, it's replaced at the next import.

 

How can I make sure that my production environment uses the SQL production database, and my development environment another SQL database, without having to modify each Flow and Canvas App after each import ?

 

For Flows, I may use environment variables, but I don't see how to proceed with the Canvas App, as the SQL connection can't use a variable for server and database name.

 

Thanks !

  • hongkong Profile Picture
    261 on at
    Re: ALM : SQL Server AAD : change server name and database name for SQL Server AAD across environment

    In my opinion, use unmanaged solution for DEV/TEST/PROD is more safe.

     

    Currently the "best practice" is not mature enough. It may work in model-driven app with dataverse but not for the other scenarios. I have tried using managed solution many times and there is no easy way to update a connection. You need to use tricks and hacks to update directly in dataverse. I think it is far more danger than using unmanaged solution.

     

  • matthhias Profile Picture
    44 on at
    Re: ALM : SQL Server AAD : change server name and database name for SQL Server AAD across environment

    Is there any article somewhere that explains best practice for SQL Connectors in DEV/TEST/PROD Scenarios?
    I thought it is best practice but I can't find an answer anywhere.
    Usage of environment variables would be also my first idea and I can't understand why this is not implemeted yet.
    Or is it?

  • hongkong Profile Picture
    261 on at
    Re: ALM : SQL Server AAD : change server name and database name for SQL Server AAD across environment

    After 1 year, the datasource environment variable is now supporting additional options. But still not supporting SQL server. May I know how do you work around it? I think the only workaround is using unmanaged solution for deployment and update the SQL server manually?

    hongkong_0-1690541205751.png

     

  • RobertLHU Profile Picture
    50 on at
    Re: ALM : SQL Server AAD : change server name and database name for SQL Server AAD across environment

    apparently the data source environment variable currently only works with Sharepoint. 😞   (228) Using environment variables in Power Apps canvas apps and in Power Automate flows - YouTube  

    RobDp3_0-1657499305156.png

     

     

  • HFG Profile Picture
    514 on at
    Re: ALM : SQL Server AAD : change server name and database name for SQL Server AAD across environment

    I also have this issue. Has anyone found a way to switch the DB in different environments? There's got to be a way!

  • mzandegiacomo Profile Picture
    92 on at
    Re: ALM : SQL Server AAD : change server name and database name for SQL Server AAD across environment

    Hello @BO55VXR , @DavidForlen 

    Right now, I am asking myself the exact same question. Did you get any further in this topic?
    Thanks,
    Martin

  • Chris Hammond Profile Picture
    130 on at
    Re: ALM : SQL Server AAD : change server name and database name for SQL Server AAD across environment

    @DavidForlen - Did you get a response on this please, it is an issue that I am now experiencing.

     

    Thanks

  • DavidForlen Profile Picture
    55 on at
    Re: ALM : SQL Server AAD : change server name and database name for SQL Server AAD across environment

    Hi @FCGALLEG ,

     

    @FCGALLEG wrote:

    [...]

    Once the connection is created, you can specify the SQL server and database name and connect to it.

     

    [...]


    I understood how to use SQL Server AAD connector on one given environment.

    But I don't see how to export my apps and flows that use a SQL Server AAD connector into an environment that must use a different SQL database (so that my development and production environment remain separate).

     

    As the server and database name are in plain text in canvas app, I don't see how to make sure that it will be automatically changed when exported to another environment.

  • Javier Gallego Profile Picture
    on at
    Re: ALM : SQL Server AAD : change server name and database name for SQL Server AAD across environment

    Hi DavidForlen,

     

    Here you have more info about the connector and the integration with Power Apps.

    https://powerapps.microsoft.com/en-us/blog/general-availability-of-the-azure-ad-sql-server-connector/

     

    Using the feature in Microsoft Power Apps

    In Power Apps, this feature is now enabled by default.  All new applications have this capability.  If you have an existing application that you need to convert to use this new authentication, you must enable it the the File > App settings > Advanced settings section.  To enable this feature, open your app in studio and enable the “Enable enhanced Microsoft SQL Server connector” feature.

     

     

    To the use the Azure AD Integrated authentication select the “Azure AD Integrated” option from the drop-down. Click on “Create” to create a connection. Note you may need to sign in to Azure AD.  Once the connection is created, you can specify the SQL server and database name and connect to it.

     

     

    Once you are connected to a database, you will be able to select the tables and views you want to add in your app from a list. This experience and the rest remain the same as before.

    Once you build the app, you can share the app. When you use Azure AD authentication with SQL Server, the connection will not be shared with the shared users.

     

    The user to who you have shared the app with, will need to login with their own credentials.

     

    I hope it helps you.

     

    Javier

     

     

     

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 87 Most Valuable Professional

#2
mmbr1606 Profile Picture

mmbr1606 71 Super User 2025 Season 1

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 65 Super User 2025 Season 1

Overall leaderboard