AL Development6 min read

AL-Go for Azure DevOps: A CI/CD Pipeline for Business Central

A practical guide to Business Central CI/CD with AL-Go for Azure DevOps: repository structure, quality gates, signing, environments, and release flow.

Target BCBC 2023 Wave 2+ (v23+)
Runtime / StackAL Language & AL-Go for Azure DevOps
DeploymentCloud SaaS & Containerized Pipelines
AL-Go for Azure DevOps Business Central CI/CD cover

An AL project with a manual publish process is not a deployment strategy. It is a collection of local machines that happen to produce an app file.

The first time two developers publish conflicting versions, or a hotfix goes out without the test app, or nobody can reproduce the build from three weeks ago, the cost becomes obvious. AL-Go exists to make the repeatable path the easy path.

What AL-Go gives you

AL-Go is a set of workflow templates and actions for building, testing, and releasing Business Central apps. The value is not a magic YAML file. It is the opinionated structure:

  • A standard repository layout.
  • Build and test workflows that understand AL.
  • Dependency resolution for Business Central and test libraries.
  • Versioning and release artefacts.
  • Code signing support.
  • Deployment workflows for Business Central environments.
  • A path to reuse the same process across apps and customers.

You can build all of this yourself. AL-Go saves you from maintaining the plumbing.

Repository shape

A clean AL repository usually looks like this:

/
  app.json
  src/
    ...
  test/
    app.json
    ...
  .github/            # if using AL-Go for GitHub
  pipelines/          # if using Azure DevOps
  .algo/              # AL-Go settings and local overrides
  README.md

The important decision is to keep the app and its tests in separate folders and, ideally, separate app files. Tests should not ship to production. A test app can reference the production app, but the production app should not depend on the test app.

If you have multiple apps, decide whether they belong in one repository or separate repositories. A shared repository is easier to version together; separate repositories are easier to permission and release independently. Both can work. Mixing the two without a dependency plan does not.

Pipeline stages

A practical pipeline has five stages.

StagePurposeGate
RestoreDownload the Business Central artefacts and dependencies.Versions resolve to a known build.
BuildCompile the app and the test app.Zero compiler errors.
AnalyzeRun code analysis and policy checks.No new critical issues beyond the agreed baseline.
TestRun the automated test suite against a Business Central environment.Required tests pass.
ReleaseSign, version, package, and publish the artefact.Approval and a clean artefact.

Deployment is a separate flow. Building an artefact is not the same as releasing it to a customer's production environment.

Quality gates that earn their place

Not every check is worth blocking a pipeline. The ones I would keep are:

Compilation

The compiler is the cheapest test. Treat warnings that indicate a real defect as failures when the team has agreed to a clean baseline.

CodeCop and AppSourceCop

If the app will be published to AppSource, AppSourceCop is not optional. If it is an internal app, CodeCop still catches patterns that make the code harder to maintain. Start with a baseline, then prevent new violations from entering.

Automated tests

A test app that only checks whether a page opens is not a quality gate. Test the business rules that are expensive to verify manually: posting logic, document numbering, permissions, integration contracts, and the edge cases that caused past incidents.

Code coverage

Coverage is a signal, not a target to game. A high percentage of trivial coverage is less useful than a focused test around a critical posting routine.

Code signing

Signing protects the app and is required for AppSource. The signing certificate must live in a secure secret store, never in the repository, and the pipeline must fail if signing is requested but unavailable.

Secrets and environments

The pipeline needs credentials. Treat them as production assets.

  • Use Azure Key Vault or the platform's secret store.
  • Scope service connections to the environments they need.
  • Separate sandbox and production credentials.
  • Use a dedicated service principal for deployments.
  • Rotate credentials on a schedule and when someone leaves.
  • Never print a token or connection string in logs.
  • Require an approval for production deployment.

Branching and versioning

A simple model is easier to operate than a perfect one.

  • Main is the integration branch. Every change is built and tested.
  • Feature branches are short-lived and merge through a pull request.
  • Release branches are created when a version must be stabilized for a customer or a release wave.
  • Tags identify the exact commit and artefact that was deployed.

Versioning should be automatic and traceable. The app.json version should map to a build, and the artefact should be reproducible. If two people can build the same version number from different commits, the process is not traceable.

Deployment

A deployment is a sequence, not a button:

  1. Select a signed artefact from a successful build.
  2. Confirm the target environment and the app dependency versions.
  3. Take a backup or confirm the environment recovery point.
  4. Install or update the app.
  5. Run smoke tests against the deployed environment.
  6. Verify the installed version and the event logs.
  7. Record the deployment in the release notes.

For Business Central cloud, the deployment mechanism depends on the environment and the AL-Go template. For on-premises or containers, the same principles apply with different tooling.

Do not deploy an app to production just because the build passed. Passed builds are the minimum bar, not a deployment approval.

A rollout plan

If you are introducing AL-Go to a team that has never had a pipeline:

  1. Start with one app and one sandbox environment.
  2. Make the build reproducible before adding tests.
  3. Add the existing test suite and fix the pipeline, not the tests, when they fail for environmental reasons.
  4. Add code analysis with a baseline that does not block delivery on day one.
  5. Add signing and a controlled release flow.
  6. Add production deployment approvals.
  7. Document the rollback path and test it.
  8. Expand to the next app only after the first flow is boring.

Boring is the goal. A pipeline that everyone understands and trusts is more valuable than a sophisticated one that only one person can debug.

Common mistakes

  • Treating the pipeline as a developer-only concern. Operations and support need to understand the release artefact.
  • Letting the test app ship with the production app.
  • Hard-coding environment URLs or credentials in the repository.
  • Allowing a production deployment from an unmerged feature branch.
  • Building a different artefact for each environment.
  • Skipping the smoke test because the unit tests passed.
  • Making every code-analysis warning a hard failure on the first day, then disabling the gate entirely.

The bottom line

AL-Go is not valuable because it is Microsoft's template. It is valuable because it turns deployment into a repeatable, reviewable process.

Start with a reproducible build, add the tests that protect the business rules, secure the signing and deployment credentials, and keep the release flow simple. Then improve it.

For the integration side of the delivery, read Designing Idempotent Business Central API Integrations. For the production triage habits that make a release easier to support, read Business Central Performance Triage.

Primary sources

Official references for this topic

Documentation and reference material from the vendor or standards body, kept alongside this article.

Full reference shelf
Wajahat Ali

Written by

Wajahat Ali

Senior Microsoft Dynamics 365 Business Central / NAV Techno-Functional Consultant with 6+ years of ERP delivery experience. Writing about Business Central, AL, integrations, reporting, and the work behind a stable go-live.

Related reading

Keep going on this thread

All articles
Chat on WhatsApp