Using AL-Go with GitHub to Simplify CI/CD for Business Central

Introduction

In today’s fast-moving world of software development, Continuous Integration (CI) and Continuous Deployment (CD) are key to building and releasing updates quickly and reliably.
For Business Central developers, AL-Go for GitHub makes this process easy by using GitHub Actions to automate builds, testing, and deployments.
It comes with ready-to-use templates that help you set up a complete CI/CD pipeline in minutes so you can focus more on coding and less on managing workflows.

Each build typically takes around 20 minutes when using containers, which fits comfortably within GitHub’s free limits for most projects 2,000 minutes per month for private repositories on the Free tier, 3,000 minutes on the Team tier, and up to 50,000 minutes on the Enterprise tier.
Since public repositories get unlimited free minutes, AL-Go for GitHub offers an affordable and powerful way to maintain professional DevOps practices without extra costs.
Overall, it’s a simple, cost-efficient, and developer-friendly solution to keep your Business Central environments up to date and running smoothly.

References

Al-Go ReadMe
AL Go - Overview
GitHub - Pricing
freddysblog - Al Go for Github
freddysblog - Deployment strategies and al go for github

Configuration

Go to Al-Go-PTE


Click on "Use this template" button.

Once the repo is created, click on Actions.
You'll see that you have an Initial commit workflow running.
On the left side, click on "Create a new app" to get started with creating a new AL app.


Click on Run Workflow and specify the name, publisher and ID range for the new AL app.
If you want the workflow to make a commit directly, set the "Direct Commit" flag.
If this is not set, then the workflow will create a pull request, which will fail if the appropriate permissions are not granted.


To allow the workflow to create a pull request go to repository settings, click on Actions on left and then scroll down.
Tick the "Allow Github Actions to create and approve pull requests" and click on Save.


Once you click on "Run workflow", we will see a new entry in the workflow runs window.


Clicking on it shows all the different tasks involved in this workflow.


Clicking on the individual task will show the logs and additional details of the task.


Once this is completed, in the commit history, we can see that there is new commit with a new app.



Now, I'll clone this repo locally so I can add some of my own files.
I've cloned the repo and added a permission set and a list page.


Next, we need to define a way for Github to access our Business Central environment.
For that, we need to set up an environment on Github.


Go to repository settings -> Environments -> New Environment.


Give it a proper name and click on "Configure environment"


Now, we need to get a value for the environment secret.
We can do that via powershell.

First install BcContainerHelp module.
Install-Module -Name BcContainerHelper
Then, run the following command to get the authcontext that needs to be added on Github.
$AuthContext = New-BcAuthContext -includeDeviceLogin

Get-ALGoAuthContext -bcAuthContext $AuthContext | Set-Clipboard 


Now, after running both the commands, the auth context will be available on your clipboard.
Then, go back to Github, click on "Add Environment Secret" and name it "AUTHCONTEXT" and paste the value.


Now, we are all set.

Now, I will commit all my changes to the main branch to verify whether the workflow is CI/CD as expected.
After commiting the changes, we can see a new entry in the workflow runs under the CI/CD workflow.


    After sometime, the pipeline run has been completed.


In Business Central, we can see that the extension has been installed successfully.

Conclusion

AL-Go for GitHub makes it much easier for Business Central developers to build, test, and deploy their apps automatically.
It takes care of most of the setup work, so you can focus on writing code instead of managing deployments.

Once everything is configured, any change you push to GitHub can be built and deployed to your environment automatically.
This helps keep your extensions up to date, reduces manual effort, and avoids mistakes.

Comments

Popular posts from this blog

Event-Driven Architecture: How to Create Custom Business Events in Business Central

Visualizing Data: How to Add Power BI Reports to Business Central

Know Your Users: Automated Usage Tracking for Better System Adoption