Overview
Power Platform integration allows you to:Unified Deployment
Deploy Business Central apps and Power Platform solutions together
Environment Sync
Keep BC and Power Platform environments in sync
Automated Workflows
Automate solution deployment with GitHub Actions
Setup Requirements
Before connecting your repository to Power Platform, you need:- AL-Go repository (PTE or AppSource template)
- Power Platform environment with Business Central integration
- Business Central environment connected to Power Platform
- Authentication credentials (service principal or username/password)
Setup Process
Connecting your GitHub repository to Power Platform involves two main steps:Configure Authentication Context
Set up how GitHub authenticates to your Power Platform and Business Central environments.
Authentication Context
The authentication context is a JSON object stored as a GitHub secret that defines how to authenticate to both Business Central and Power Platform.Naming Convention
Authentication contexts use this naming pattern:Production, the secret would be PRODUCTION_AUTHCONTEXT.
Service Principal Authentication (Recommended)
Use a service principal with client secret for secure, automated authentication.Create Service Principal
Follow the detailed setup guide to create a service principal with appropriate permissions for both Business Central and Power Platform.
Generate Authentication Context
Use BcContainerHelper to generate the authentication JSON:The authentication context JSON is now in your clipboard.
Service principal authentication requires an Azure AD app registration with API permissions for both Dynamics 365 Business Central and Power Platform APIs.
Username/Password Authentication
For non-MFA tenants, you can use username/password authentication.AL-Go Repository Settings
Configure your.github/AL-Go-Settings.json file to define Power Platform integration.
Basic Configuration
Configuration Properties
- powerPlatformSolutionFolder
- environments
- DeployTo Settings
Power Platform Solution FolderSpecifies the folder containing your Power Platform solution files.This folder should contain:
- Solution files exported from Power Platform
- Canvas apps, model-driven apps, or flows
- Connection references and environment variables
Getting Power Platform Environment URL
Access Power Platform Admin Center
Navigate to https://admin.powerplatform.microsoft.com
Getting Business Central Company ID
Alternatively, use PowerShell to retrieve the company ID:
Complete Setup Example
Here’s a complete example configuration:File Structure
AL-Go-Settings.json
GitHub Secrets
Create these environment secrets:PRODUCTION_AUTHCONTEXT(in Production environment)TEST_AUTHCONTEXT(in Test environment)
Deployment Workflow
Once configured, AL-Go automatically deploys both Business Central and Power Platform components:Trigger Deployment
Deployments can be triggered by:
- Publishing a release
- Running the “Publish To Environment” workflow manually
- Automatic deployment on successful CI/CD (if configured)
AL-Go Deploys BC Apps
AL-Go compiles and deploys Business Central extensions to the specified environment and company.
AL-Go Deploys PP Solutions
If a Power Platform solution folder is configured, AL-Go deploys the solution to the specified Power Platform environment.
Advanced Configuration
Multiple Power Platform Solutions
If you have multiple Power Platform solutions, you can specify an array:Environment-Specific Solutions
Deploy different solutions to different environments:Skip Power Platform Deployment
To deploy only Business Central apps without Power Platform solutions:Troubleshooting
Authentication failed to Power Platform
Authentication failed to Power Platform
Common causes:
- Service principal doesn’t have required permissions
- Client secret has expired
- Username/password authentication used with MFA-enabled tenant
- Incorrect tenant ID or client ID
- Verify service principal has Dynamics 365 and Power Platform API permissions
- Regenerate client secret and update authentication context
- Switch to service principal authentication
- Double-check all IDs in authentication context
Power Platform environment URL not found
Power Platform environment URL not found
Common causes:
- Incorrect environment URL format
- Environment doesn’t exist or has been deleted
- Service principal doesn’t have access to environment
- Verify URL format:
https://orgXXXXXXXX.crm.dynamics.com - Check environment exists in Power Platform Admin Center
- Grant service principal System Administrator role in Power Platform
Business Central company ID invalid
Business Central company ID invalid
Common causes:
- Company ID is not a valid GUID
- Company doesn’t exist in the specified environment
- Incorrect environment name
- Verify company ID format:
12345678-1234-1234-1234-123456789012 - List companies using BC API or PowerShell
- Confirm environment name matches exactly
Solution deployment failed
Solution deployment failed
Common causes:
- Solution folder doesn’t exist
- Invalid solution files
- Missing dependencies in target environment
- Solution requires manual configuration steps
- Verify folder path is correct relative to repository root
- Export solution again from Power Platform
- Deploy dependent solutions first
- Review solution import logs in Power Platform
Best Practices
Use Service Principals
Always use service principal authentication for production environments instead of username/password
Separate Environments
Maintain separate GitHub environments for development, test, and production
Version Control Solutions
Store Power Platform solutions in source control using solution files, not just deployed solutions
Test Deployments
Always test deployments in non-production environments before deploying to production
Security Recommendations
Solution Management
Export Unmanaged Solutions
During development, work with unmanaged solutions in your development environment.
Export as Managed
Export solutions as managed solutions for deployment to test and production environments.
Integration Scenarios
Scenario 1: BC Extension with Power Apps UI
Deploy a Business Central extension with a Power Apps canvas app that extends the BC UI:- AL-Go deploys BC extension
- AL-Go deploys Power Apps solution
- Power Apps connects to BC using data connector
Scenario 2: Automated Power Automate Flows
Deploy BC extensions with Power Automate flows for automation:- BC extension raises events
- Power Automate flows respond to events
- Automate notifications, approvals, data sync
Scenario 3: Multi-Environment ALM
Manage application lifecycle across environments:- Develop in Development environment
- Deploy to Test for validation
- Promote to Production after approval
Monitoring and Diagnostics
Enable telemetry to monitor Power Platform deployments:- Deployment success/failure rates
- Deployment duration
- Authentication issues
- Solution import errors
Next Steps
Service Principal Setup
Detailed guide for creating service principals
Azure KeyVault
Store authentication contexts securely in KeyVault
CI/CD Workflows
Automate deployments with GitHub Actions
Enable Telemetry
Monitor Power Platform deployment performance