Staging mode

SunBird sites are released to an Azure App Service staging slot, checked, then swapped into production. The staging slot uses the live database, so SunBird runs there in staging mode.

Turning it on

Set this app setting on the staging slot, marked as a deployment slot setting so it stays with the slot when swapping:

SunBird__Mode = Staging

The setting is Mode in the SunBird section, and its values are Live (the default) and Staging. Any other value, such as a misspelling, stops the site starting, so a typo cannot leave publishing switched on. See Settings.

What staging mode does

  • Edit mode shows a banner on the toolbar saying this is staging, on live content.
  • Editors can save and view drafts, preview any version, and read the history.
  • Anything that changes what visitors see is turned off, for pages and for shared fragments:
    • Save and publish, Schedule... and Publish this version are not offered.
    • Cancel schedule is not offered, since it changes what goes live.
    • Unpublish and Delete page are not offered for added pages.
    • The matching endpoints refuse the request with 403 and a message saying this is the staging site, so a request made by hand cannot publish either.
  • Adding a page from a template still works. The new page is a draft, and stays hidden until it is published on the live site.
  • Agents working through the MCP server can add pages and save drafts, but are not offered the tools that publish, schedule, roll back, unpublish or delete, and are refused if they call them.

Releasing new content

  1. Deploy the release to the staging slot.
  2. In staging, build the content for new or changed pages as drafts.
  3. Swap staging into production.
  4. In production, open each draft and publish it. To release it at a set time instead, schedule it there.

Rule for developers

Staging (new code) and production (old code) share the database during a release, so every database migration must work with both. Migrations only add (expand); anything removed is removed in a later release (contract).