Guides
Create BC Queries
Use the BC2Fab query generator in Dynamics 365 Business Central to build AL queries that surface the tables and fields you need inside Microsoft Fabric.
Generate custom queries with BC2Fab
The guided workflow helps you pick tables, include the right fields, and export a ready to deploy AL package. Watch the walkthrough below to see the end-to-end process.
Build and publish an App with the new API queries in Visual Studio Code
The new queries generated for BC2Fabric need to be built into an AL extension and published to your Business Central environment. This section provides step-by-step instructions on how to do this using Visual Studio Code..app file is built and validated, deploy it to your
production environment via Extension Management.
Follow these steps to build and publish your generated .app in Visual Studio Code.
1) Install Visual Studio Code and the AL extension
- Install Visual Studio Code from code.visualstudio.com.
-
Open VS Code and install Microsoft AL Language:
Extensions (
Ctrl+Shift+X) → searchAL Language→ Install.
2) Create an AL project
- Start VS Code
- Open the Command Palette (
Ctrl+Shift+P) and runAL: Go!. - Accept the default folder or choose an empty folder where the app should be created in
- Choose the target platform that matches your BC environment
- Choose Microsoft Cloud Sandbox as Server
- Delete HelloWorld.al from the project if it was auto-created
-
Confirm the project was created with:
app.json,.vscode/launch.json.
3) Generate launch.json from the Business Central web client
- Open your Business Central environment in the browser.
- Use the Generate launch configurations for this environment action in the Troubleshooting section of the Help & Support page.
- Visual Studio Code will open and use the generated launch.json file.
- Reference walkthrough: Generate launch.json from the web client in Business Central (Wave 1 2025).
- Download symbols (first-time setup)
- Open Command Palette (`Ctrl+Shift+P`).
- Run AL: Download Symbols.
4) Add the generated BC2Fab files
- Unzip the package exported from Query generator in BC2Fab.
-
From the zip, copy and paste
app.jsoninto the root of your VS Code AL project (overwrite existing file). - Copy the src-Folder that includes the AL objects from the ZIP-File into your AL project folder.
5) Update app.json values
6) Download symbols and build
- Run
AL: Download Symbolsfrom the Command Palette. - Build with
Ctrl+Shift+B(or runAL: Package). - Select the Sandbox from the launch configuration dropdown.
- A Success message will appear in the Output window.
- After a successful build, locate the generated
.appfile in the output folder of the AL-project.
7) Publish and install in production
- Open Business Central in your production environment.
- Search for and open Extension Management.
- Select Manage → Upload Extension.
- Select the
.appfile built in the previous step. - The selection
Deployment for(current version) can remain as is, same as the synchronization settings. - Choose Deploy and wait for completion.
- Search the extension in the list of extensions and check the "Is Installed" flag to be set. If not click "Install" on the extension overview.
- The new query-object(s) should now be available to be used in the BC2Fabric table config.
References
- Microsoft AL development getting started: Get started with AL
-
App manifest (
app.json) reference: JSON files reference - Packaging/deploying extensions: Deploy extensions
Troubleshooting
Required permissions for deploying the extension
The user who uploads and installs the extension in Business Central must have sufficient permissions in both Business Central and the Microsoft 365 / Azure AD tenant.
-
Business Central permission set: The deploying user needs the
D365 EXTENSION MGTpermission set assigned in Business Central, or theSUPERpermission set. Without this, the Upload Extension action in Extension Management will not be available. - Azure AD / Entra ID role (Business Central Online): For SaaS environments, the user must hold the Dynamics 365 Business Central Administrator role in the Microsoft 365 admin center, or be a Global Administrator. Delegated admin partners can also deploy extensions on behalf of a customer.
-
Sandbox access for development: The developer building the AL app
needs access to a Business Central sandbox environment and should have the
D365 DEVELOPERorSUPERpermission set to download symbols and publish during development.
AL: Download Symbols fails
If AL: Download Symbols fails with an authentication error, verify that your
launch.json points to the correct environment URL and that you are signed in to
VS Code with the same account that has access to the BC sandbox. Re-generating
launch.json from the BC web client (Help & Support → Troubleshooting) is the
fastest way to ensure the configuration is correct.
Build errors after adding BC2Fab files
-
Target platform mismatch: Make sure the
runtimeandapplicationversions inapp.jsonmatch your BC environment version. Check the BC version under Help & Support → About. -
Missing symbols: Run AL: Download Symbols again after
replacing
app.json, as the new manifest may reference different dependencies.
Extension deployment fails or stays "in progress"
After uploading, check the deployment status in Extension Management by selecting the extension and viewing its Deployment Status. Common causes:
-
Version already exists: You cannot overwrite an extension with the same
version number. Increment the
versionfield inapp.json(e.g.1.0.0.0→1.0.1.0) and rebuild before re-uploading. - Schema sync errors: A table or field in the AL query conflicts with existing data. Review the error details in the deployment log shown in Extension Management.
-
Insufficient permissions: Ensure the deploying user has the
D365 EXTENSION MGTpermission set and the required Azure AD role (see above).
Adding new or replacing existing queries in the app
When your query requirements change — whether adding new tables, removing queries that are no longer needed, or replacing a test set with the final one — the approach depends on whether the existing queries are already configured in BC2Fabric.
-
Adding queries while keeping existing ones: generate the additional
queries in BC2Fab, add the new
.alfiles to your AL project, increment theversioninapp.json, rebuild, and deploy. Existing queries and their BC2Fabric table configurations remain untouched. -
Replacing queries (e.g. swapping out a test set for the final one):
update the
.alfiles in your project, increment theversioninapp.json, rebuild, and redeploy via Extension Management → Upload Extension. BC will upgrade the extension in place. Note that any BC2Fabric table configurations pointing to removed queries will need to be reconfigured after the upgrade.
In both cases, keep the same id GUID in app.json so BC
recognises the new .app as belonging to the same extension. Only include
queries that are actually needed.
Queries do not appear in the BC2Fabric table configuration
After deployment, confirm the extension is both installed and enabled:
- Open Extension Management and find the extension in the list.
- Verify the Is Installed flag is set. If not, select Install.
- If the query still does not appear, sign out and sign back in to Business Central to refresh available objects, then reopen the BC2Fabric table configuration page.