Need Assistance with Power Apps / Power Automate Cross Tenant Deployment

Hello,

I’m working on a cross-tenant deployment of a Power Platform solution — specifically Power Apps and Power Automate — and running into major issues with how the connections are handled when moving to the destination (end-user) tenant.

The problem is that connections are caching the development tenant’s credentials**, and when I import the solution into the target tenant, it forces me to manually reconnect every single connection individually.

For example:

  • I have a Power App** with 20+ SQL stored procedures and tables connected.
  • Upon importing the app into the new tenant, it prompts me to reconnect each SQL connection separately. Keep in mind that connected SQL procs also make you rename them when you add the data source in Power Apps.
  • It cannot find the referenced connections because they are linked to the dev tenant’s environment/credentials and not dynamically pointing to a new connection resource in the destination tenant.

This obviously isn’t scalable as I plan to deploy across multiple clients/tenants.

What I’m looking for:

  • Is there a best practice to avoid having to manually reconnect each data source during cross-tenant deployments?
  • Should I be using something like Environment Variables tied to connections? (I have used Environment Variables before, but I am not sure if it solves the SQL procs/tables references in the app itself.)
  • Is there a better way to package the app/flows so that the connections can be mapped dynamically at import time?
  • Are there limitations I should be aware of when using SQL Server as a data source across tenants during this kind of deployment?
  • Any advice or examples for how others are handling cross-tenant connection remapping for SQL-heavy apps?

I want to make sure I’m not missing something fundamental, as manually remapping 20-30 connections per app per tenant is not practical long-term.

It sounds like you’re dealing with a complex and challenging scenario. Here are some best practices and strategies that might help streamline your cross-tenant deployment process:

1. Use Environment Variables

Environment variables can be very useful for managing different configurations across environments. They allow you to store configuration settings, such as connection strings, which can be dynamically updated when you move your solution to a new environment. This can help avoid hard-coding values and make your deployment process more flexible[2][1].

2. Connection References

Using connection references within your solutions can help manage connections more effectively. Connection references allow you to define connections in a way that they can be easily reconfigured when importing solutions into different environments. This can significantly reduce the manual effort required to reconnect each data source [2] [3].

3. Deployment Settings File

For fully automated deployments, consider using a deployment settings file. This JSON file can pre-populate connection references and environment variables specific to the target environment, reducing the need for manual intervention during the import process[2].

4. SQL Server Considerations

When using SQL Server as a data source across tenants, be aware of potential limitations and best practices:

  • Authentication: Ensure that your SQL Server authentication method is compatible with cross-tenant scenarios. Managed identities or app registrations might be necessary[4].
  • Networking: Properly configure networking settings, such as private endpoints and DNS zones, to ensure seamless connectivity between tenants [4].
  • Resource Management: Utilize features like elastic pools and sharding to manage resources efficiently across multiple tenants [5].

5. Examples and Community Insights

Looking at how others handle similar scenarios can provide valuable insights. For instance, some users have shared their experiences and solutions on forums and community blogs. These can offer practical advice and examples that might be directly applicable to your situation.

Summary

  • Environment Variables: Use them to manage configuration settings dynamically.
  • Connection References: Implement them to simplify connection management.
  • Deployment Settings File: Automate the deployment process with pre-populated settings.
  • SQL Server Best Practices: Ensure proper authentication, networking, and resource management.

By implementing these strategies, you can make your cross-tenant deployments more scalable and less manual. If you have any specific questions or need further clarification on any of these points, feel free to ask!

References

[1] Use environment variables in Power Platform solutions - Power Apps …

[2] Pre-populate connection references and environment variables for …

[3] Use a connection reference in a solution with Microsoft Dataverse

[4] Connect from web app to Azure SQL across tenants?

[5] Azure SQL Database considerations for multitenancy - Azure Architecture …

1 Like