Dynamics 365 Business Central: AppSource submission of library apps used by different extensions

Exactly about one year ago I’ve talked about the possibility to create Library Apps and submit them on AppSource. The original post is here if you want to read it.

What is a Library App?

It’s a normal extension (.app file) that your real extension (the extension you want to publish on AppSource and make it visible) depends on (dependencies setting on app.json file) and that you can submit together with your real extension. This library extension will not be visible on AppSource.

When a customer downloads your extension from the AppSource marketplace, this library extension is automatically installed together with your published extension.

Can I use a Library App with more than one extension?

Yes, absolutely. Library Apps are borned for decoupling extensions and for helping on creating a “common layer” of functionalities that you can reuse between different extensions.

If I have N extension that uses the same Library App, how can I publish it on AppSource?

You can upload your Library App (digitally signed) directly from the AppSource portal together with one of the extensions that will use it (if you have more that one Library App where your extension depends on, you can zip all these Library Apps into a single .zip package and upload this .zip package to the portal directly).

When approved, the next extensions that you will submit and that have references to a previously published Library App, will take those dependencies references. Obviously, if you submit an app that has dependencies from some Library Apps and those Library Apps are not found on AppSource, validation will fail.

Error when submitting multiple Library Apps with multiple extensions

I saw Partners submitting on AppSource different extensions that uses the same Library Apps at the same time. This scenario is prone to an error like the following:

The validation of the submission failed with the following error(s): Error AVS0107: The extension 'XXXX' by 'YYYY' (version 'W.X.Y.Z') has already been uploaded to Business Central for the country/region 'XX'. Remove this extension from your submission, use the same .app file as the one that has already been uploaded to Business Central, or increase the version in the app.json. 

Why this error?

Imagine the following scenario: a partner is submitting app A and app B on AppSource at the same time (same day for example) and both apps depends on two library apps (L1 and L2), like in the following diagram:

If you submit the apps in the following way:

  • App A is submitted with libraries L1 and L2 in a zip package
  • App B is submitted without libraries

you could have errors on validating app B if this validation happens before the validation of app A (and so before the publishing of the library apps).

To avoid this scenario, many partners does the submit process as follows:

  • App A is submitted with libraries L1 and L2 in a zip package
  • App B is submitted with libraries L1 and L2 in a zip package

Microsoft permits you to include the same libraries in multiple AppSource offers, but the library apps must be exactly the same (same app file with AppId and version and created from the same build).

What does that mean in practice?

It means that the above scenario works correctly without errors if you submit L1 and L2 with same version and same build for both offers (so, same .app file of libraries L1 and L2 for both offers A and B).

But if, for example, you submit App A with libraries L1 and L2 and then, before submitting app B, you rebuild the library app L1 (getting a new .app file) and then you submit app B with L1 and L2, this will cause the above mentioned validation error.

To summarize with a schema:

This is a quite “hidden” behaviour that could cause you headaches, so please remember it.

Personal recommendation: submit exactly the same .app file for your library apps (if you really need to submit apps with dependencies from libraries at the same time) or submit your apps and libraries in the correct order (so for example, A with L2 and L2 and when A is approved you can submit B without libraries).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.