Environments
bsm.yaml: dev, test, prod and everything that differs between them.
bsm.yamlprovider: sqlserver
defaultEnvironment: dev # also: BSM_ENV, or --env / -e
variables: {} # see Variables
environments:
_azure: # '_' prefix: template, used only through extends
database: App
tls: { mode: strict }
authentication: entraInteractive
entra: { tenantId: 7f3c1e2a-0000-0000-0000-000000000000 }
dev:
extends: _azure
host: myapp-dev.database.windows.net
prod:
extends: _azure
description: Production
host: myapp-prod.database.windows.net
protected: true
allowRevert: false
ordering: strict
Inheritance
extends names another environment (or template) to start from. Maps merge key by key, so entra: in a child adds to the template's entra:; values and lists are replaced. Chains are allowed, cycles are errors. bsm env show -e prod prints the merged result with secrets masked; bsm env list shows every environment.
Settings
| Key | Default | Meaning |
|---|---|---|
description | Shown in env list; {env.description} | |
host, port, database | port 1433 | Where to connect |
connectionString | Raw SqlClient connection string; the fields above override it | |
authentication, user, password, entra | Authentication | |
tls, connectionProperties, ssh | Connection settings | |
protected | false | Deploy, revert, rebase, baseline and destructive provisioning require typing the environment name, or --yes |
allowRevert | true | false refuses revert and rebase |
ordering | dependency | dependency or strict (Teams) |
stateSchema | bsm | Schema for the journal tables |
commandTimeoutSeconds | driver default (30) | Per-batch timeout |
lockTimeoutSeconds | 300 | Wait for another deployer |
variables | Environment-specific variables | |
alwaysEncrypted | Always Encrypted keys | |
schemaFingerprint | partitionBoundaries: ignore for databases whose partitions a job splits and merges (Partitions) |
Unknown keys inside known blocks (for example a misspelled entra.tennantId) are errors, so typos never silently fall back to defaults.
Secrets
Any value can reference ${env:NAME} (an environment variable) or ${file:path} (a file, such as a mounted secret). They are resolved only for the environment being used, so a missing production secret never breaks a dev run. Never commit passwords; bsm.yaml belongs in source control.
Database ownership
The first deploy records the environment name in the database. If you later run as a different environment against that database (for example prod settings pointing at a test server after a copy-paste mistake), bsm refuses:
error: This database belongs to environment 'test', but you are running as 'prod'. Check --env and the
connection settings. If the database was intentionally copied (e.g. prod restored into test), pass --claim-environment.
--claim-environment re-records the database under the new name. Every journal event also records the environment that wrote it.
Environment-only scripts
See Repeatables: environments/<name>/**/*.sql runs only there.