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.
Sandbox first, then production. Always develop and build your AL app against a Business Central sandbox environment. Once the .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

  1. Install Visual Studio Code from code.visualstudio.com.
  2. Open VS Code and install Microsoft AL Language: Extensions (Ctrl+Shift+X) → search AL LanguageInstall.

2) Create an AL project

  1. Start VS Code
  2. Open the Command Palette (Ctrl+Shift+P) and run AL: Go!.
  3. Accept the default folder or choose an empty folder where the app should be created in
  4. Choose the target platform that matches your BC environment
  5. Choose Microsoft Cloud Sandbox as Server
  6. Delete HelloWorld.al from the project if it was auto-created
  7. Confirm the project was created with: app.json, .vscode/launch.json.

3) Generate launch.json from the Business Central web client

  1. Open your Business Central environment in the browser.
  2. Use the Generate launch configurations for this environment action in the Troubleshooting section of the Help & Support page.
  3. Visual Studio Code will open and use the generated launch.json file.
  4. Reference walkthrough: Generate launch.json from the web client in Business Central (Wave 1 2025).
  5. Download symbols (first-time setup)
    • Open Command Palette (`Ctrl+Shift+P`).
    • Run AL: Download Symbols.

4) Add the generated BC2Fab files

  1. Unzip the package exported from Query generator in BC2Fab.
  2. From the zip, copy and paste app.json into the root of your VS Code AL project (overwrite existing file).
  3. 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

  1. Run AL: Download Symbols from the Command Palette.
  2. Build with Ctrl+Shift+B (or run AL: Package).
  3. Select the Sandbox from the launch configuration dropdown.
  4. A Success message will appear in the Output window.
  5. After a successful build, locate the generated .app file in the output folder of the AL-project.

7) Publish and install in production

  1. Open Business Central in your production environment.
  2. Search for and open Extension Management.
  3. Select ManageUpload Extension.
  4. Select the .app file built in the previous step.
  5. The selection Deployment for (current version) can remain as is, same as the synchronization settings.
  6. Choose Deploy and wait for completion.
  7. 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.
  8. The new query-object(s) should now be available to be used in the BC2Fabric table config.

References

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 MGT permission set assigned in Business Central, or the SUPER permission 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 DEVELOPER or SUPER permission 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 runtime and application versions in app.json match 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 version field in app.json (e.g. 1.0.0.01.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 MGT permission 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 .al files to your AL project, increment the version in app.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 .al files in your project, increment the version in app.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:

  1. Open Extension Management and find the extension in the list.
  2. Verify the Is Installed flag is set. If not, select Install.
  3. 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.