Skip to content

Cheat sheet ​

Everything you'll look up twice, on one page. Print it, pin it, tattoo it (we don't judge).

The STORYTELLER_* variables ​

The configuration provider, Hosting, the C# SDK, sform, the GitHub Action and the Aspire integration all read the same names.

Who and where

VariableMeaning
STORYTELLER_ENDPOINTThe API, /api included: https://api.2s.42for.net/api. http only to localhost
STORYTELLER_KEYThe full key of the process: @house.main.default.exe.northwind.invoicing.production

One credential, pick a kind

KindVariables
API keySTORYTELLER_API_KEY
Certificate (mTLS)STORYTELLER_CLIENT_CERTIFICATE (a .pfx) and STORYTELLER_CLIENT_CERTIFICATE_PASSWORD; alone or with an API key
Client credentialsSTORYTELLER_CLIENT_ID, STORYTELLER_CLIENT_SECRET, usually STORYTELLER_TOKEN_URL and STORYTELLER_TOKEN_SCOPE
FederationSTORYTELLER_CLIENT_ID and STORYTELLER_TOKEN_FILE, or just STORYTELLER_CLIENT_ID in a GitHub Actions job with id-token: write
A bearer token in a fileSTORYTELLER_TOKEN_FILE alone

Two kinds at once is an error that names both. sform account machine create prints the right set for you.

The provider's knobs

VariableDefault
STORYTELLER_MODEresolved (or effective)
STORYTELLER_REFRESH_INTERVAL30s; 0 turns polling off
STORYTELLER_OPTIONALfalse
STORYTELLER_CACHE_DIRnone

sform also reads STORYTELLER_PROJECT (house.main) and STORYTELLER_VIEW; the provider doesn't need them, because the key says it all.

Keys ​

CodeTypeKey
sbtSubjectsbt.{subject}
rstResponsibilityrst.{responsibility}
cntContextcnt.{subject}.{context}
untUnitunt.{responsibility}.{unit}
usgUsageusg.{subject}.{responsibility}
exeExecutionexe.{subject}.{responsibility}.{context}
uxeUnit of executionuxe.{subject}.{responsibility}.{context}.{unit}

A full key puts @{organization}.{project}.{view}. in front. The configuration of an execution merges, from general to specific: responsibility → subject → usage → context → execution.

Roles of people ​

Reader < Contributor < ContributorWithSecrets < Administrator < Owner

You want toYou need
Read the catalog and configurationsReader
Write annotations and configurations, create machinesContributor
Read or write secrets, create a machine with secret scopesContributorWithSecrets
Members, policies, export and import, machines with management scopesAdministrator

Scopes of machines ​

Machines have no role; their scopes decide.

ScopeLets itsform account machine create
Annotation.Read, Configuration.ReadRead annotations and configurationsthe default (-r)
Annotation.Write, Configuration.WriteWrite them-w
Secrets.ReadReceive secrets in resolved documents-r --scope secrets-read
Secrets.WriteWrite secret pairs--scope secrets-write
Management scopesBulk and structural work: transfers, schemas, templates, deletes-m configuration-transfer,schema-write,…

-a <key> restricts a machine to one annotation and everything under it. Give every service the narrowest one you can.

When things go sideways ​

You seeIt meansTry
StorytellerConfigurationException at startup naming a variableA setting is missing or malformedSet the variable it names; the message never prints the value
401No credential, or a wrong oneCheck the credential variables; one kind only
403 with AccessDeniedThe machine lacks a scope, or your role is too lowThe message names the scope; create a machine with it (machines can't be edited)
403 with AnnotationRestrictedThe machine is restricted to another annotationRestrict it to the key you read, or to an ancestor of it
404The key doesn't exist, or it's in another project or viewCheck STORYTELLER_KEY, organization, project and view included
X-2S-Secrets-Withheld: mtls-requiredThe machine may read secrets, but the project delivers them only over mTLSGive it its certificate (STORYTELLER_CLIENT_CERTIFICATE)
Values that still start with @The caller may not read secrets, so secret bindings stay unresolvedCreate a machine with -r --scope secrets-read, or store a reference that your app resolves instead
Status.IsDegraded and Origin is CacheIt started from the last-known-good copy while the platform was awayNothing: it catches up on its own
OptionsValidationException for a customer in a workerThat customer has no subscription right nowCatch it per customer; the Removed event follows
422 with format.…The document can't be written in that formatThe message names the JSON path; rename the property

Still stuck? The reference documentation lives in docs/Platform/Storyteller on GitHub, and sform <command> --help knows more than it lets on.

Released under the MIT License.