Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need Help with Admin/Dev API Reference #3587

Open
Andrei15193 opened this issue Jun 27, 2024 · 2 comments
Open

Need Help with Admin/Dev API Reference #3587

Andrei15193 opened this issue Jun 27, 2024 · 2 comments

Comments

@Andrei15193
Copy link

Describe the issue

Hi, I'm currently looking for ways to automate the build & publish process for a Business Central extension and I'm having trouble finding the admin/dev API reference. What I have found online points me to the admin web API that I do not know how to access.

More context, we are using on-prem instances of Business Central which we access using our internal IP addresses. They are mostly for development, it looks something like this: 192.0.0.10:8080/BCInstance1 to access the UI and we have a dev port for it as well which we use to download symbols/packages and publish the extension through the VS Code extension.

I managed to get around what the extension is doing up to publishing the extension by calling the dev(?) web API. To get the packages I perform get requests to 192.0.0.10:12345/BCInstance1/dev/packages?publisher=Microsoft&appName=System&VersionText=22.0.0.0&tenant=default. It works, it gets me the packages then I check the manifest for dependencies and eventually get everything I need.

I managed to replicate what AppHandling/Publish-NavContainerApp.ps1 is doing and publish the app to 192.0.0.10:12345/BCInstance1/dev/app using a post request with a multi-part payload.

The issue I keep running into is that there's hardly any documentation or reference for these endpoints and I was wondering if I'm simply missing it or there is a way I can get some documentation on the dev web API.

The reason I ended up calling the endpoints directly is because of authentication, we use user/password and windows authentication depending on the instance and I got the requests to work for user/password using basic authentication when calling the endpoint. For windows authentication or Entra ID is probably similar granted I get a token and set the authentication headers properly.

What I'm having trouble with now is getting the runtime version of an extension, unpublishing it and deleting it. I can't find and web API endpoints that I can call to do this, is it even possible?

We want to perform CI/CD in the end, to build and publish extensions to on-prem and cloud instances of business central from a pipeline.

My issues boil down to the following.

  • What web API can I use to download symbols, publish an extension/app, get the runtime package for it, unpublish and delete a package? Please provide examples
  • Are there PowerShell scripts or anything similar that I can use or look at to get this information from?
@freddydk
Copy link
Contributor

A lot of questions, which isn't really related to Containers and BcContainerHelper, but I can answer one

The dev endpoint is not documented. Why not use the PowerShell cmdlets to install your extension?

You might want to look at https://www.alops.be/ - I strongly recommend people to use a managed DevOps solution instead of building their own.

@Andrei15193
Copy link
Author

Thanks for answering this, I'm just a bit lost with getting this to work after searching and trying a lot of things.

I had a quick look at https://www.alops.be/, it might work if we switch to Azure DevOps.

You mentioned PowerShell cmdlets, can you please give me a link to them? I've tried a few and couldn't get them to work, while others come with the BC installation (I think).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants