Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

How to Seamlessly Deploy a Canvas App Connected to Business Central Across Environments?

(5) ShareShare
ReportReport
Posted on by 12
I’ve built a Canvas app integrated with Business Central (formerly Navision) as the database, and I want to publish it on Microsoft AppSource—similar to the Play Store. However, I’m facing a major deployment challenge.
 
When exporting the app from one environment and importing it into another, I have to manually open it in edit mode, reselect the tables, and reconnect the database. This makes deployment to client environments tedious and impossible to automate.
 
Is there a way to streamline this process so the app can automatically link to the appropriate Business Central database upon import—without manual intervention? Any insights would be greatly appreciated!
 
  • Vahid Ghafarpour Profile Picture
    8,777 Super User 2025 Season 1 on at
    How to Seamlessly Deploy a Canvas App Connected to Business Central Across Environments?
    If any of the responses helped resolve your issue, please take a moment to mark the best answer. This helps others in the community quickly find solutions to similar problems.

    To do this, simply click the "Does this answer your question?" button on the most helpful response and like the helpful posts. If your issue is still unresolved, feel free to provide more details so the community can assist further!

    Thanks for being an active part of the Dynamics 365 Community! 😊
  • Suggested answer
    Daivat Vartak (v-9davar) Profile Picture
    5,229 Super User 2025 Season 1 on at
    How to Seamlessly Deploy a Canvas App Connected to Business Central Across Environments?
    Hello aryansharma,
     

    You've identified a significant pain point when deploying Canvas apps that connect to Business Central (or any data source requiring connections) across different environments. The manual reconnection process is indeed a major hurdle for AppSource submissions and general deployment automation.

    Unfortunately, there's no direct, fully automated way to make a Canvas app automatically reconnect to the correct Business Central database upon import without any manual intervention. This is a fundamental limitation of how Canvas app connections are handled.

    Understanding the Problem:

    • Connection References: Canvas apps use connection references to store the connection details to data sources. These references are environment-specific.
    • Environment-Specific IDs: When you export a Canvas app, the connection references contain environment-specific IDs that don't translate across environments.
    • Security and Isolation: This behavior is designed to ensure security and prevent accidental cross-environment data access.

    Workarounds and Strategies (with Limitations):

    1. Power Platform CLI (Command Line Interface):

      • Concept: Use the Power Platform CLI to automate some parts of the deployment process.

      • Steps:

        • Export the Canvas app as a .msapp file.
        • Use the pac canvas import command to import the app into the target environment.
        • Use the pac paportal connection create and pac paportal connection reference create commands to create the connection and connection reference in the target environment.
        • Use the pac canvas patch-environment-variables or pac canvas update-data-sources commands to update the app's data sources. 

      • Limitations:

        • Still requires some manual configuration of connection details.
        • Requires scripting and technical expertise.
        • Doesn't fully automate the reconnection process. 
         

    2. Environment Variables (Limited Applicability):

       

      • Concept: Use environment variables to store connection-related information.

      • Steps:

        • Create environment variables in the target environment to store the Business Central environment details (e.g., tenant ID, environment name, API URL).
        • Modify your Canvas app to use these environment variables to dynamically construct the connection string. 

      • Limitations:

        • Doesn't fully automate the connection creation.
        • Requires careful management of environment variables.
        • Only partially solves the problem.  

    3. Azure Logic Apps or Power Automate Flows (Post-Import):

       

      • Concept: Create an Azure Logic App or Power Automate flow that runs after the app is imported.

      • Steps:

        • Trigger the flow when a new Canvas app is imported.
        • Use the Power Platform connectors to identify the app's connection references.
        • Use custom code or actions to update the connection references with the correct Business Central connection details. 

      • Limitations:

        • Requires development and maintenance of a separate flow.
        • Adds complexity to the deployment process.
        • Still relies on some manual configuration.  

    4. AppSource Pre-Deployment Instructions:

      • Concept: Provide detailed instructions to customers on how to manually reconnect the app after installation.

      • Steps:

        • Create a step-by-step guide that explains how to find the Business Central connection details and update the app's data sources.
        • Include this guide in your AppSource listing and documentation. 

      • Limitations:

        • Relies on manual configuration by the customer.
        • Can lead to a poor user experience.

        •  
          

    Key Recommendations:

    • Power Platform CLI (Most Practical): While not fully automated, the Power Platform CLI provides the most practical approach for streamlining the deployment process.
    • AppSource Pre-Deployment Instructions (Essential): Regardless of your automation efforts, provide clear and detailed instructions to customers.
    • Feedback to Microsoft: Provide feedback to Microsoft about this limitation and request improvements in Canvas app deployment.

    Important Considerations for AppSource:

    • User Experience: AppSource prioritizes a smooth and seamless user experience. Manual reconnection steps can negatively impact your app's rating.
    • Testing: Thoroughly test your deployment process in various environments.
    • Documentation: Provide comprehensive documentation for your app.

    •  

    Unfortunately, the current limitations of Canvas app connections make fully automated deployment challenging. Focus on using the Power Platform CLI and providing clear instructions to customers.

     
    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more. If you have further questions, please feel free to contact me.
     
    My response was crafted with AI assistance and tailored to provide detailed and actionable guidance for your Microsoft Dynamics 365 query.
     
    Regards,
    Daivat Vartak
  • Suggested answer
    Holly Huffman Profile Picture
    4,649 on at
    How to Seamlessly Deploy a Canvas App Connected to Business Central Across Environments?
    Hi there! Good morning, evening, or afternoon - depending on where you are :) Hope you are well today!
     
    Deploying a Canvas App integrated with Business Central across environments can indeed be streamlined. Here's how you can address the challenge:
     
    Challenges with Current Deployment
    The issue arises because Canvas Apps hard-code connection information (e.g., environment name, company ID) into the app source code. When moving the app to a new environment, these connections must be manually updated, which is tedious and prevents automation.
    Solutions to Streamline Deployment
    1. Use Environment Variables:
      • While Power Apps doesn't natively support environment variables for Canvas Apps, you can leverage Power Automate flows to store and dynamically update connection information.
      • Define environment variables for Business Central environment name and company ID, and use them in your flows to update the app's connection settings.
    2. AL-Go for GitHub Template:
      • Microsoft provides the AL-Go for GitHub template, which includes functionality to update connection information in Power Apps source code during deployment.
      • By defining your Business Central environment name and company ID in the AL-Go settings file, GitHub actions can automatically update the app's connection details when deploying to a new environment.
    3. Custom Deployment Scripts:
      • Create a PowerShell script or Azure DevOps pipeline to automate the process of updating connection settings in the app source code before deployment.
    4. Publish to AppSource:
      • When publishing the app to AppSource, ensure that the app is designed to dynamically retrieve connection information based on the user's environment. This may require additional customization.
    5. Best Practices for Power Apps with Business Central:
    Hope this 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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,639 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,663 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans