Greetings Community - Having used the BC API Automation before, this is the first time I am facing a weird situation.
My goal is to publish a simple extension through automation API, following the 3 steps listed by MS here in this link. https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/itpro-introduction-to-automation-apis#upload-and-install-a-per-tenant-extension
The first part has been successful, which talks about POST : Insert Extension Upload
I am stuck in the part where through a PATCH request, the binary file is to be uploaded. I want to publish this extension to CRONUS (OOTB Company)
This gitHub discussion says that instead of {appID}, the correct parameter to pass in the URL is {packageID} from an extension metadata
My extension has not been published yet, how can I get a PackageID of an extension when it's not yet been published and moreover pass it in the PATCH request? Is there a way through powershell or something else to obtain an extensions PackageID? I see PackageID as a response when I use GET Extensions from the same BC Environment, but these are extensions already published in the environment
My request header is IF-MATCH: *
My request body is the .app file which I want to publish
FYI: Using a trial version of BC, probably has expired but not sure if it will fit this context
An Update for everyone reading this thread:
I was successfully able to decode the answer to my question above, after some deep research. Here are some pointers for you:
1. Microsoft has specified that you need 3 requests sent to the automation API for your extension to successfully load into Business Central (POST, PATCH, POST). The english names of these 3 requests is "Insert Extension Upload", "Upload Extension File" & "Install Extension"
Of which the first request is to send a POST, which will intimate table 5447, that a new extension is now getting uploaded. From my experience, this table will have only one record at a time and the record in this table will be deleted/archived/won't bother you once you are done with all 3 steps to publish an extension via API
The response of the first POST Request, is very important. The response contains a value named "System ID", which is nothing but your "PackageID"
2. Use this System ID/Package ID in your upcoming/next PATCH request, in the parameter named "extensionUploadId" in
PATCH api.businesscentral.dynamics.com/v2.0/{environment name}/api/microsoft/automation/v2.0/companies({companyId})/extensionUpload({extensionUploadId})/extensionContent
Now you're good to go. You now have the PackageID of the extension, even before it is published.
Hello,
Feel free to raise this to Microsoft via your partner or CSP.
Thank you.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,134 Super User 2024 Season 2
Martin Dráb 229,928 Most Valuable Professional
nmaenpaa 101,156