Business Central SaaS Extension from Scratch (Repo-backed, Azure DevOps)
Prerequisites
(must be done once per laptop)
- Install Visual Studio Code.
- Install Git for Windows.
- In VS Code → Extensions,
install:
- AL Language (Microsoft)
- Azure Repos (Microsoft) (optional but
helpful)
- Make sure you can sign in to:
- Azure DevOps
- Business Central SaaS tenant (Microsoft Entra ID / Azure
AD)
Part A —
Create the Azure DevOps Repo (Empty)
Step A1 —
Create a new project (only if needed)
If you
already have a DevOps Project, skip this.
- Azure DevOps → New Project
- Name: e.g. bc-bcextension-01
- Visibility: Private
- Create
Step A2 —
Create an empty Git repository
- Go to Repos → Files
- Select New repository
- Type: Git
- Name: e.g. bc-bcextension-01
- ✅ Do NOT initialize with README
- ✅ Do NOT add .gitignore
- Create
✅ Result: Repo page shows: “repo is
empty”.
Part B —
Clone Repo to Your PC
Step B1 —
Create a local working folder
Example:
- Create folder: C:\BC\
Step B2 —
Clone the empty repo
Choose
either method:
Option 1
(simple): Clone in VS Code
- In Azure DevOps repo page →
click Clone in VS Code
- Pick local folder:
- C:\BC\bc-bcextension-01
- VS Code opens the repo
Option 2:
Clone using Git command line
- Copy HTTPS clone URL from Azure
DevOps
- Run in terminal:
- cd C:\BC
- git clone
<paste-clone-url> bc-bcextension-01
- Open VS Code → File → Open
Folder → C:\BC\bc-bcextension-01
✅ Result: Local folder contains a .git
folder and nothing else.
Part C —
Add .gitignore (Before generating AL project)
Step C1 —
Create .gitignore at repo root
Create file
here:
- ✅ C:\BC\bc-bcextension-01\.gitignore
Paste this
content:
# Business
Central / AL generated artifacts
.alpackages/
.alcache/
.snapshots/
*.app
# VS Code
(keep only shared config)
.vscode/*
!.vscode/launch.json
!.vscode/settings.json
# OS files
.DS_Store
Thumbs.db
Step C2 —
Commit and push .gitignore
In VS Code
Source Control:
- Stage .gitignore
- Commit message: Add gitignore
- Push / Sync
✅ Repo now has 1 commit.
Part D —
Create the AL Project (Scaffold) in the Repo
Key rule
(IMPORTANT)
✅ The folder you select for AL: Go!
must NOT exist yet.
We will
generate the AL project into a new folder called src.
Step D1 —
Run AL: Go!
- Open VS Code with repo root:
- C:\BC\bc-bcextension-01
- Press: Ctrl + Shift + P
- Run: AL: Go!
- When it asks for a folder
location:
- Enter/select:
- C:\BC\bc-bcextension-01\src
- Do NOT create src manually. Let AL create it.
✅ Result: VS Code creates src folder
and generates project files inside.
Part E —
Configure the BC SaaS Connection (launch.json)
Step E1 —
Open the generated launch.json
File path:
- C:\BC\bc-bcextension-01\src\.vscode\launch.json
Replace
content with your SaaS sandbox config (example):
{
"version": "0.2.0",
"configurations": [
{
"name": "BC SaaS
Sandbox",
"type": "al",
"request": "launch",
"server":
"https://businesscentral.dynamics.com",
"tenant":
"7f9c2a8e-4b6d-4c3a-9e51-0d2a9b8c6f41",
"environmentName":
"Sandbox",
"authentication":
"MicrosoftEntraID",
"startupObjectType":
"Page",
"startupObjectId": 22,
"breakOnError":
"All",
"launchBrowser": true
}
]
}
Note: "tenant": "7f9c2a8e-4b6d-4c3a-9e51-0d2a9b8c6f41" provided here is only for illustration; a valid tenant id must be provided here.
✅ This ensures it uses SaaS + Entra
ID, not On-Prem.
Part F —
Set app.json Correctly (Runtime, IDs, name)
Step F1 —
Edit app.json
File path:
- C:\BC\bc-bcextension-01\src\app.json
Set these
fields clearly:
- name = your extension name
- publisher = your
company/publisher
- idRanges = your object range
- runtime must match your target
version
Example:
{
"id": "YOUR-GUID-HERE",
"name": "BCExtension-01",
"publisher": "MicroCloud
360",
"version": "1.0.0.0",
"brief": "Business Central
Extension 01",
"description": "Business
Central SaaS Extension",
"dependencies": [],
"idRanges": [
{ "from": 50100, "to":
50149 }
],
"runtime": "17.0",
"features": [
"NoImplicitWith" ]
}
✅ (Use a new GUID for each app—AL
usually generates it for you.)
Part G —
Download Symbols (Required before coding properly)
Step G1 —
Download Symbols
- Open the AL project folder:
- In VS Code, ensure you are
working inside src
- Ctrl + Shift + P
- Run: AL: Download Symbols
✅ Result:
- .alpackages gets populated
- Errors like “cannot find
Customer List” disappear
Part H —
Build + Publish to BC SaaS Sandbox
Step H1 —
Publish from VS Code
- Ctrl + Shift + P
- Run: AL: Publish
You will be
asked to login (browser sign-in) the first time.
✅ Result:
- Extension is deployed to your Sandbox
environment.
Part I —
Verify in Business Central
Step I1 —
Confirm extension is installed
In BC:
- Search: Extension Management
- Find your extension under:
- Installed / Published list
(depends on role/permissions)
- Confirm version number matches
your app.json
Step I2 —
If fields/pages not visible
If you added
fields to a page extension:
- Open the page
- ⚙️ Settings → Personalize
- Add fields to columns / layout
if needed
- If still hidden:
- ⚙️ Settings → Reset personalization
Part J —
Commit Code to Repo (Proper workflow)
Step J1 —
Commit generated project + config
In VS Code
Source Control:
- Stage changes (app.json,
launch.json, AL files, etc.)
- Commit message: Initial AL
project scaffold
- Push
✅ Now your repo contains the full AL
project.
Part K —
Work from Another Laptop (Proves repo-backed setup)
On a second
laptop:
- Install prerequisites (VS Code,
Git, AL extension)
- Clone repo to local folder
- Open repo root in VS Code
- Open src
- AL: Download Symbols
- AL: Publish
✅ Same project works anywhere.
No comments:
Post a Comment