navcontainerhelper
navcontainerhelper copied to clipboard
Ability to unpublish specific version number of an extension in a SaaS environment
This isn't an issue but more of a request.
Could you create a Unpublish-PerTenantExtensionApps script where you can unpublish specific versions of an extension in a BCSaaS environment.
This would be useful so when I publish an extension using Publish-PerTenantExtensionApps to my SaaS sandboxes via my pipeline's I can then also unpublish the uninstalled extensions to keep the sandbox environments clean of none installed extensions.
Hi Freddy,
I think my requests relates to this issue: I'd like to uninstall some dev-apps from a SaaS environment.
Publish-BCContainerApp
e.g. works fine with with the parameters bcAuthContext
and environment
, but it seems that Unpbulish-BcContainerApp
is missing these parameters. Is that doable?
The alternative would be to uninstall apps via the BC Admin API. But unfortunately that isn't working for dev-extensions.
@freddydk can you maybe give a short statement if you would pick this up?
Otherwise I'd create a support request for the BC Admin API that the uninstall endpoint
https://api.businesscentral.dynamics.com/admin/v2.11/applications/BusinessCentral/environments/$environmentName/apps/$appIdToUninstall/uninstall
should work for dev-extensions as well, but I could assume that they'd refuse it.
I will investigate what can be done.
Awesome, thanks!
Hello Freddy! Do you have any news regarding this topic? Thanks!
Hello @freddydk, are there already some news?
It should be possible to uninstall and unpublish apps through the automation API: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/resources/dynamics_extension#bound-actions
or through the admin center API https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/administration-center-api_app_management#uninstall-an-app
The automation API should work for both Dev scope and PTEs
I haven't tried and won't have time to investigate right now, if anybody wants to submit a PR with a new function, I will find the time to review.
At a first glance: The automation API does not offer a bound action to unpublish extensions. The admin center API only lists AppSource or firstparty apps, so Dev scope or PTEs are not available here.
So if you use the BC-container-helper's Publish-PerTenantExtensionApps to automate updating PTEs through a deployment pipeline, you'll soon have a history of old versions of the PTE cluttering the customer's list of installed (published) extensions:
I guess this was the intention of the OP and it's the reason why I'm here looking :)
Hello, did someone solve or found a way to unpublish those cluttered PTE apps?
@SBalslev - do you know how people can get rid of old PTE versions? (or do you know who knows)
Hi, also wondering the same thing? Is it possible to unpublish PTE:s through the API? @SBalslev
Hello. Has anybody found a solution for this problem?
We have the same issue.
Would it make sense to enter an idea in the https://experience.dynamics.com/ideas/-Portal under development and vote for it?
Here is an old existing idea that I just voted for: https://experience.dynamics.com/ideas/idea/?ideaid=c35221d7-717a-eb11-8fed-0003ff45e089
I voted too - could everyone please also share the idea and vote for it?
Many people have shown interest for this, if my skills in AL code would allow me, I would add this myself, but they don't :-(
I just want to mention that the source code for APIV2 is here: https://github.com/microsoft/ALAppExtensions/tree/main/Apps/W1/APIV2/app
And if you know how to write app code, you can actually add the code yourself by starting here: https://github.com/microsoft/ALAppExtensions/issues/new?assignees=&labels=bcidea&projects=&template=bcidea.yaml&title=%5BBC+Idea%5D%3A+ - specify which idea you want to implement and add the code in a PR.
It is probably a fairly small effort for a skilled app developer - but please create the issue before the PR and discuss best implementation together.
Looking forward to see a solution, which I can implement in BcContainerHelper and AL-Go for GitHub afterwards... :-)
There are several solutions to the problem - one method could be to have a function, which would unpublish all uninstalled apps - this way we can just call that method after installations - and if the installation has a schedule - it won't do anything until next time around.