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.

Requirements for Freshness Window and where the course covered each.
RequirementDesign responseLesson
Warn or block shipments and transfers below a freshness thresholdCheck on release and on posting of warehouse shipments, sales shipments and transfers9
Thresholds per customer, item category or itemSetup tables with a clear precedence: item, then category, then customer, then default9
Measure from best-before date or from production dateA setup choice per item category9
Let partners add customer rulesPublic procedure and integration events; most code internal9
Show freshness in integrationsAn API page with freshness per lot, read-only, with read scale-out1, 7
Explain decisions to usersActionable errors, teaching tips and a help page11
Observe use and problemsApp telemetry to Quarrystone's Application Insights; feature telemetry7
Upgrade safely for yearsUpgrade codeunit with tags from version 1.06

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.

The main parts of the Freshness Window manifest. The app ID, links and connection string are placeholders.
{
  "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.

A timeline from early November to November 23, 2026. Early November: product decision, affix QFW and ID range registered, repository from AL-Go-AppSource. Then: self-validation finds ToBeClassified fields and version 26 compile errors; application property raised to 27.0. November 13: first submission fails at the manifest stage because the app name differs from the offer name. November 20: version 1.0.5.0 resubmitted and passes technical validation. November 23: in certification. A dashed segment after November 23, labelled planned, shows preview for pilots, then go live.
Freshness Window from decision to certification.

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.

Readiness checklist at the end of the case.
CheckStatus on November 23, 2026
Affix QFW and ID range registeredDone
AppSourceCop clean, CodeCop and UICop cleanDone
84 automated tests passing in the pipelineDone
Self-validation for ca and us, 27.0 to currentDone
Technical validationPassed November 20
Certification and marketing validationIn progress
Preview for pilotsPlanned
Go livePlanned

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
  1. The type change is schema-breaking and AppSourceCop will reject it against the 1.0 baseline.
  2. Add a new Decimal field with the new name.
  3. In the upgrade codeunit, guarded by an upgrade tag, copy the integer values into the new field.
  4. Mark the old field ObsoleteState = Pending with a reason pointing to the new field, and keep reading it for dependent apps during the transition.
  5. 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
  1. 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.
  2. The stack shows the freshness check reading the Lot No. Information record for each line with all fields.
  3. Add SetLoadFields for the two date fields needed and cache results per lot during one posting.
  4. 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
  1. The product's API already exposes days of freshness per lot, read-only with read scale-out.
  2. Showing a marketing message on a web shop is specific to Corbel & Finch.
  3. 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.
  4. 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
  1. Install Freshness Window first, because CF Roastery 1.5 declares it as a dependency and cannot install without it.
  2. Configure the setup with the same thresholds as the old code, which Callum tests in CONFIG beforehand.
  3. 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.
  4. 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
  1. An API page with DataAccessIntent = ReadOnly, or an API query if the data is aggregated.
  2. 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.
  3. Isolated Storage for the key, held as SecretText.
  4. 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.

  1. 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.

  2. 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.

  3. 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.

Take the quiz