MSBA-353 · Lesson 12 of 12 · 27 min
Case study: publishing an app
▶ Video coming soon A video version of this lesson is on the way.
This final lesson puts the course together in one case: how Quarrystone Business Systems took the freshness logic from three per-tenant extensions and turned it into Quarrystone Freshness Window, its first Microsoft Marketplace app. The work ran from the decision in early November to a submission that passed technical validation on November 20, 2026 and was in certification on November 23. Corbel & Finch appears as one of three pilot customers, alongside a tea blender and a bakery supplier; the product itself belongs to Quarrystone. The case is told as a sequence of decisions, each tied to an earlier lesson, followed by problems to work through. Read it as a template: most first Marketplace apps from small partners face the same decisions in the same order.
The brief
Food and beverage businesses that sell perishable goods by lot need to know, before stock leaves, whether it is fresh enough for the customer. Business Central's item tracking stores lot numbers and expiration dates, as MSBA-351 showed, but it does not warn a warehouse that a lot has only three weeks left when a grocery chain requires six, or stop a café transfer of a coffee roasted too long ago. Quarrystone's brief for the product, agreed by the managing partner and Noor, was short.
| Requirement | Design response | Lesson |
|---|---|---|
| Warn or block shipments and transfers below a freshness threshold | Check on release and on posting of warehouse shipments, sales shipments and transfers | 9 |
| Thresholds per customer, item category or item | Setup tables with a clear precedence: item, then category, then customer, then default | 9 |
| Measure from best-before date or from production date | A setup choice per item category | 9 |
| Let partners add customer rules | Public procedure and integration events; most code internal | 9 |
| Show freshness in integrations | An API page with freshness per lot, read-only, with read scale-out | 1, 7 |
| Explain decisions to users | Actionable errors, teaching tips and a help page | 11 |
| Observe use and problems | App telemetry to Quarrystone's Application Insights; feature telemetry | 7 |
| Upgrade safely for years | Upgrade codeunit with tags from version 1.0 | 6 |
Decision 1: scope and the public surface
The first decision was what not to build. The pilots asked for label printing, recall reports and a mobile app. Noor kept version 1.0 to freshness checks, setup, the API and the events, because every public element is a promise that AppSourceCop will hold Quarrystone to, and a small first version is easier to validate, support and extend. The public surface was written down before coding: one setup API, the procedure that returns days of freshness left, the procedure that returns the decision, and four integration events, raised before and after the check and before and after the action. Everything else was Access = Internal. The tea blender's special rule, which treats loose-leaf lots differently from sachets, became the first test of the design: it was written in that customer's PTE, using an event, without touching the product.
Decision 2: registrations, names and versions
Quarrystone registered the affix QFW and an object ID range for its publisher, obtained a code-signing certificate, and created the offer in Partner Center. Every object and field name in the app carries the QFW prefix, so a customer's own field called "Freshness Days" can coexist with the product's "QFW Freshness Days". The app.json name, publisher and version were chosen to match the offer exactly, a rule that lesson 10 showed the team learning the hard way. The minimum supported version, set by the application property, was raised to 27.0.0.0 after self-validation, because the code used features unavailable in version 26.
{
"id": "3c7e9a51-8b20-4f6d-a1c4-5e2d7b9f0a18",
"name": "Quarrystone Freshness Window",
"publisher": "Quarrystone Business Systems",
"version": "1.0.5.0",
"brief": "Warn or block shipments and transfers of lots below a freshness threshold.",
"privacyStatement": "https://quarrystone.example/privacy",
"EULA": "https://quarrystone.example/terms",
"help": "https://quarrystone.example/freshness/help",
"url": "https://quarrystone.example/freshness",
"logo": "logo/qfw-logo.png",
"application": "27.0.0.0",
"idRanges": [ { "from": 70450100, "to": 70450199 } ],
"features": [ "TranslationFile" ],
"supportedLocales": [ "en-CA", "en-US", "fr-CA" ],
"applicationInsightsConnectionString": "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://example.invalid/",
"resourceExposurePolicy": { "allowDebugging": false, "allowDownloadingSource": false, "includeSourceInSymbolFile": false }
}The resource exposure policy keeps the source private, which is normal for a commercial app. The supported locales and the TranslationFile feature mean the app ships XLIFF translations, including French, because two of the pilots expected French-speaking users in Canadian deployments; the translation work was done once, in the product, rather than in each PTE.
Decision 3: data and permissions
Every field received a data classification, most of them CustomerContent or SystemMetadata. Two permission sets, QFW - USER for warehouse and sales users and QFW - ADMIN for setup, cover every object, and the setup page explains which to assign. The code that reads the app's own setup uses inherent permissions, so a warehouse user who has QFW - USER but not read access to every setup table still gets the check. Because a user with no permission set at all must not silently bypass freshness checks, the check runs whenever the app is installed, and the permission sets control only who can change setup and override decisions.
Decision 4: tests before features
The test app was created on the first day, with AL-Go's Create a new test app workflow. By submission it held 84 tests: unit tests for date arithmetic, including leap years and lots without dates; integration tests that post warehouse shipments and transfers with lots near the threshold; permission tests that run as QFW - USER and as a user without it; UI tests for the setup page and the override action; and an upgrade test that installs a simulated earlier data layout. The October rounding bug from lesson 5 had taught the team to write a failing test before fixing anything, and the habit carried over. A small performance toolkit scenario posted shipments with fifty lot lines, to confirm that the check adds milliseconds, not seconds.
Decision 5: the pipeline
The repository was created from AL-Go-AppSource. Its settings turned on AppSourceCop with QFW as a mandatory affix, CodeCop and UICop, set the countries to ca and us, and named the test folder. Pull Request Build ran on every change. The scheduled Test Next Minor and Test Next Major workflows compiled and tested the app against upcoming Business Central versions weekly. The pipeline signed the app with the certificate held in Quarrystone's Azure Key Vault. AL-Go can also deliver new versions to Partner Center automatically with an AppSourceContext secret; Quarrystone kept delivery manual for the first release, so a person submitted each version, and planned to automate it once the process was familiar.
Decision 6: telemetry and support
The app's manifest points at Quarrystone's Application Insights resource, so every installation sends app telemetry to the publisher. Custom events log each freshness decision with the decision type and days left, but never customer names or lot contents, and with SystemMetadata classification. Feature telemetry records setup completion and use, which tells Quarrystone which pilots have actually switched the feature on. A support page, a help site linked from the app.json help URL, teaching tips on the setup page and actionable errors that say which threshold blocked a shipment were all part of version 1.0, because Marketplace customers may never speak to Quarrystone before they install.
Decision 7: the offer and the listing
The Partner Center offer holds what customers see: the name, a short and long description, screenshots, a video, the categories and industries, the markets, the pricing, and links to support, privacy and terms. Quarrystone selected Canada and the United States as markets, which also set the countries for validation. Pricing in the first year is through Quarrystone's own contract, with a free trial period for evaluation, so the listing uses the "contact me" style of call to action rather than marketplace transactions. The marketing checklist required that the description match what the app does and that documentation be reachable, which the help site satisfied. The offer also defined a preview audience of the three pilot tenants.
Validation and what came next
Lesson 10 described the two submissions. In short: self-validation caught the data classification and minimum version problems before submission; the first submission on November 13 failed because the offer name differed from the app name; version 1.0.5.0, submitted on November 20, passed technical validation in about twenty minutes. On November 23 the offer was in certification. The plan after that, not yet carried out, was preview installations in each pilot's sandbox, a feedback cycle, and go-live of the listing; for Corbel & Finch, any installation will follow its own go-live and hypercare, with the old freshness code removed from CF Roastery in the same release so the two never warn twice.
| Check | Status on November 23, 2026 |
|---|---|
| Affix QFW and ID range registered | Done |
| AppSourceCop clean, CodeCop and UICop clean | Done |
| 84 automated tests passing in the pipeline | Done |
| Self-validation for ca and us, 27.0 to current | Done |
| Technical validation | Passed November 20 |
| Certification and marketing validation | In progress |
| Preview for pilots | Planned |
| Go live | Planned |
Problems to work through
The following problems use the Freshness Window case. Try each before reading the worked answer in the example blocks; each draws on several lessons.
Worked problem
Problem 1: renaming a field in version 1.1
For version 1.1, a designer wants to rename the public field "QFW Min. Days Left" to "QFW Minimum Freshness Days" and change it from Integer to Decimal to allow half days. What can Quarrystone do?
Show solution
- The type change is schema-breaking and AppSourceCop will reject it against the 1.0 baseline.
- Add a new Decimal field with the new name.
- In the upgrade codeunit, guarded by an upgrade tag, copy the integer values into the new field.
- Mark the old field ObsoleteState = Pending with a reason pointing to the new field, and keep reading it for dependent apps during the transition.
- Remove it in a later version, after announcing the change to partners who build on the app.
Answer: Add, migrate, obsolete, then remove over several versions; never change the type in place.
Worked problem
Problem 2: a pilot's warehouse is slow
After the preview install, the bakery supplier reports that posting warehouse shipments with many lots became slow. How does Quarrystone investigate without access to the bakery's data?
Show solution
- Query Quarrystone's app telemetry for long-running AL methods (RT0018) and SQL (RT0005) with the QFW objects in the stack, filtered to that tenant.
- The stack shows the freshness check reading the Lot No. Information record for each line with all fields.
- Add SetLoadFields for the two date fields needed and cache results per lot during one posting.
- Add a performance toolkit scenario with 200 lot lines to the pipeline so the regression cannot return, and release a fix.
Answer: Use the publisher's app telemetry to find the slow code, fix it with partial records and caching, and protect it with a performance scenario.
Worked problem
Problem 3: the web shop wants freshness data
Corbel & Finch's web shop wants to show "roasted within the last two weeks" on product pages. Should Quarrystone add this to the product's API, or should Noor add it to CF Roastery?
Show solution
- The product's API already exposes days of freshness per lot, read-only with read scale-out.
- Showing a marketing message on a web shop is specific to Corbel & Finch.
- The web shop can call the product's API through the same Entra app from lesson 1, with read permission on it added to its permission set.
- No new code is needed in the product; a few lines in the web shop decide the message.
Answer: Use the product's existing API from the web shop and keep the customer-specific presentation outside the product.
Worked problem
Problem 4: a dependency upgrade order
CF Roastery 1.5 will depend on Freshness Window and remove its own freshness code. In what order should the two be deployed to Corbel & Finch's PROD?
Show solution
- Install Freshness Window first, because CF Roastery 1.5 declares it as a dependency and cannot install without it.
- Configure the setup with the same thresholds as the old code, which Callum tests in CONFIG beforehand.
- Deploy CF Roastery 1.5 through the pipeline; its upgrade code moves the old threshold settings into the product's setup and the old fields become obsolete.
- Check telemetry the next morning for freshness decisions from the product and none from the old code.
Answer: Dependency first, then the dependent PTE with upgrade code that moves its settings, tested in CONFIG and confirmed in telemetry.
Worked problem
Problem 5: an exam-style scenario
A developer must let an external system read freshness per lot efficiently, notify a Teams channel when a lot is blocked, store an external service key, and prove the feature works for a user without SUPER. Which AL features fit?
Show solution
- An API page with DataAccessIntent = ReadOnly, or an API query if the data is aggregated.
- A business event raised when a lot is blocked, consumed by a Power Automate flow, or a webhook-enabled API if a record change suffices.
- Isolated Storage for the key, held as SecretText.
- A test codeunit with TestPermissions set to Restrictive and only the app's user permission set assigned.
Answer: API page or query with read scale-out, a business event or webhook, Isolated Storage with SecretText, and permission-restricted tests.
Common mistakes
MistakeShipping everything customers ask for in version 1.0.
InsteadKeep the first version and its public surface small; every public element is a long-term promise.
MistakeWriting tests after the features.
InsteadCreate the test app on day one and write failing tests before fixes.
MistakeAutomating Partner Center delivery before the process is understood.
InsteadSubmit manually at first, then automate with AppSourceContext.
MistakeLeaving telemetry for later.
InsteadShip app telemetry in version 1.0, without customer data.
MistakeInstalling a product alongside old PTE code that does the same job.
InsteadRemove the old code in the same release that adds the dependency.
Summary and key terms
- A first Marketplace app starts with a small scope and a written public surface.
- Registrations, names and the minimum version must match between app.json, Partner Center and validation.
- Data classification, permission sets and inherent permissions make the app safe for any customer.
- Tests, analyzers, signing and scheduled next-version builds come from the AL-Go AppSource pipeline.
- App telemetry, actionable errors and help are part of version 1.0.
- The offer defines markets, pricing and a preview audience; validation, certification, preview and go-live follow in order.
- Public surface
- The procedures, events, tables and fields other apps may depend on.
- Inherent permissions
- Permissions granted to code regardless of the user's permission sets.
- Resource exposure policy
- Manifest settings that control debugging and source access for an app.
- Offer
- The Partner Center record that defines a Marketplace listing, markets and pricing.
- Pilot customer
- A customer who tests an app in preview before it goes live.
Practice problems
Work each problem on paper first, then reveal the answer to check.
Why was the tea blender's special rule placed in its own PTE?
Show answer
It is specific to one customer; the product exposes an event so the rule can be added without changing the product.
Which three Marketplace preparations happened before any code was submitted?
Show answer
Registering the affix and ID range, obtaining a code-signing certificate and creating the Partner Center offer.
What remained to be done after November 23, 2026?
Show answer
Finishing certification, preview installs for pilots, a feedback cycle and go-live of the listing.
Lesson quiz · 5 questions
Score 60% or more to complete this lesson.
Create a free account to save your progress, take quizzes and earn a certificate.