Rayfin

Environments and configuration

Understand Rayfin environment files, deployment records, frontend variables, and workspace targeting rules.

Rayfin uses checked-in configuration for desired state and gitignored files for local deployment targets and generated runtime values.

File locations

PathPurposeCommit it
rayfin/rayfin.ymlDesired service configuration.Yes
rayfin/.envLocal deployment values, RAYFIN_PUBLIC_*, and interpolation inputs.No
rayfin/.env.exampleDocumented placeholders for teammates.Yes
rayfin/.project.jsonScaffold lineage identifier.Usually yes
rayfin/.deployments.jsonRecorded Fabric deployments and active target.No
.env.local or package .env.localFramework variables generated from rayfin/.env.No
~/.rayfin/auth.json and token cacheCLI sign-in state.No

Frontend-visible variables

Rayfin variableVite variableDescription
RAYFIN_PUBLIC_API_URLVITE_RAYFIN_API_URLManaged Fabric backend API URL.
RAYFIN_PUBLIC_PUBLISHABLE_KEYVITE_RAYFIN_PUBLISHABLE_KEYPublic SDK key.
RAYFIN_PUBLIC_ITEM_IDVITE_FABRIC_ITEM_IDFabric item ID.
RAYFIN_PUBLIC_WORKSPACE_IDVITE_FABRIC_WORKSPACE_IDFabric workspace ID.
RAYFIN_PUBLIC_TENANT_IDVITE_FABRIC_TENANT_IDEntra tenant ID.
RAYFIN_PUBLIC_PORTAL_URLVITE_FABRIC_PORTAL_URLFabric portal base URL.
RAYFIN_PUBLIC_FRONTEND_PORTVITE_PORTStable local frontend port used by rayfin dev (Next.js maps it to PORT).
RAYFIN_PUBLIC_FUNCTIONS_URLVITE_RAYFIN_FUNCTIONS_URLLocal Functions URL while rayfin dev runs Functions.

CI and automation variables

VariableUse
RAYFIN_TOKENPre-acquired token for headless automation when service principal login is not used.
RAYFIN_TENANT_IDAmbient tenant equivalent to --tenant.
RAYFIN_WORKSPACE_IDAmbient workspace target for rayfin dev and rayfin up. Do not combine with --capacity-id.
RAYFIN_ENV_FILEAlternate env file path, equivalent to --env-file.
RAYFIN_ENCRYPTION_FALLBACK_ENABLEDAllows plaintext token cache when the OS keychain is unavailable. Use for development environments only.
RAYFIN_FEATURE_FLAGSExperimental feature opt-ins, such as storage.

Workspace targeting

InputApplies toNotes
--workspace <name>rayfin dev, rayfin upResolves a Fabric workspace display name.
--workspace-id <id>rayfin dev, rayfin upTargets a Fabric workspace GUID.
--workspace-uri <uri>rayfin upDerives the workspace ID from a Fabric portal URL.
RAYFIN_WORKSPACE_IDrayfin dev, rayfin upAmbient non-interactive target.
--capacity-id <id>rayfin dev, rayfin upAssigns capacity when creating or preparing a target. New in 1.36

Resolution priority

When the same value is available in more than one place, Rayfin resolves it in this order:

  1. Shell environment variables.
  2. The file passed with --env-file, or the file named by RAYFIN_ENV_FILE.
  3. rayfin/.env.
  4. Defaults from rayfin.yml interpolation or CLI defaults.

Variable interpolation in rayfin.yml

Use shell-style interpolation to keep environment-specific values out of checked-in config:

rayfin/rayfin.yml
services:
  staticHosting:
    assetAccess: ${STATIC_ASSET_ACCESS:-protected}
  data:
    dialect: ${RAYFIN_DATA_DIALECT:-mssql}
SyntaxMeaning
${VAR}Requires VAR to be set and non-empty.
${VAR:-default}Uses default when VAR is unset or empty.

When the entire YAML value is an interpolation, Rayfin preserves booleans and numbers where the resolved value can be parsed as that type. Partial interpolation always produces a string.

Multiple deployments

Use separate Fabric workspaces for environments such as dev, test, and production. One checkout can record each deployment in rayfin/.deployments.json:

npx rayfin up --workspace-id <dev-workspace> --item-name my-app-dev
npx rayfin up --workspace-id <test-workspace> --item-name my-app-test
npx rayfin up --workspace-id <prod-workspace> --item-name my-app-prod
npx rayfin up list
npx rayfin up switch prod-workspace

A switch changes the active deployment for local commands. It does not copy data or promote a build; use Deployment pipelines for Fabric stage promotion.

PromptAdd a staging deployment target
Configure my Rayfin project for a staging Fabric workspace. Run `npx rayfin up --workspace-id <staging-workspace-id> --item-name <staging-item-name>`, then `npx rayfin up list` and `npx rayfin up switch --workspace-id <staging-workspace-id>`. Confirm rayfin/.env and the frontend .env.local now point at staging.
Something wrong on this page?Report an issueEdit this page

On this page