Custom API: Enumerating Installed Apps in Business Central On-Premises

In our day-to-day with Microsoft Dynamics 365 Business Central, the need to know which applications are currently installed in our On-Premises environment may arise. Unlike Business Central On Cloud, where we have a specific API to enumerate the tenant’s extensions (you can get more information here and here), in the On-Premises version this functionality is not so straightforward. (At least today I did not find a native way to do it if someone knows how I would greatly appreciate it).

However, today I will show you how you can overcome this obstacle by creating a small extension with a custom API.

Table of Contents

  • Business Central Code.
  • Using API in Postman.

Business Central Code

To create the code, I used a Custom API based on the “NAV App Installed App” table. I discovered this approach thanks to this fantastic post: How to list all installed extensions/apps in your Business Central environment (Including hidden apps – “Exclude……”). This post provides more detailed information about applications installed in Business Central, and I highly recommend giving it a read.

Below is the API code:

Using API in Postman

The Custom API built works for both versions of Business Central On-Premises/On Cloud, and below I will show examples of how to make the requests.

In the case of On-Premises I am using Basic Authentication, in the case of On Cloud, AOuth2, of latter I leave more information on how to connect in this previous post.

On Premises:

HTTP request
http://<URL base>:<Port>/<Instance>/api/<APIPublisher>/<APIGroup>/<APIVersion>/companies(aaaaaaaca-bbbb-ccc-dddd-000eeeeeee7)/<EntitySetName>
Example:
http://200.xx.xxx.xxx:7048/BC220/api/ivansingleton/app1/v1.0/companies(aaaaaaaca-bbbb-ccc-dddd-000eeeeeee7)/InstalledApps
Postman

On Cloud:

Although the title of the post mentions Business Central On-Premises, I want to take advantage of the Post to show how the call would be implemented in the On Cloud version.

HTTP request
https://api.businesscentral.dynamics.com/v2.0/<EnviromentName>/api/<APIPublisher>/<APIGroup>/<APIVersion>/companies(aaaaaaaca-bbbb-ccc-dddd-000eeeeeee7)/<EntitySetName>
Example
https://api.businesscentral.dynamics.com/v2.0/Sandbox/api/ivansingleton/app1/v1.0/companies(aaaaaaaca-bbbb-ccc-dddd-000eeeeeee7)/InstalledApps
Postman

Getting the list of Extensions natively

Finally, I show how to do it natively in the On Cloud version using Automation APIs.

Here I tried to do the same in the On-Premises version but I had no success, I did not find information on the internet either and that is where if someone knows how to do it I would like you to let me know. (I think that maybe if the credentials are approved to be used with AAD it could work)

HTTP request

GET /microsoft/automation/v2.0/companies({companyid})/extensions

Example

https://api.businesscentral.dynamics.com/v2.0/<Your-Tenant-Id>/<Enviroment-Name>/api/microsoft/automation/v2.0/companies(aaaaaaaca-bbbb-ccc-dddd-000eeeeeee7)/extensions

Conclusions

Customizing Business Central is one of the greatest strengths of this Microsoft tool. As we’ve seen, creating a custom extension can unlock functionalities that, while not directly available, can prove highly useful in our daily operations.

The solution presented today will enable you to maintain a clear, up-to-date record of all the applications installed in your Business Central On-Premises environment. Feel free to explore and adapt this code to meet your specific needs.

Remember, the true beauty of Business Central lies in its flexibility and adaptability. With a bit of knowledge and creativity, the possibilities are virtually limitless

CODE

You can get the whole project at this GitHub link.

Leave a Reply

Your email address will not be published. Required fields are marked *