Rayfin

Environment variables

Exhaustive Rayfin 1.36.2 environment variable reference for frontend builds, CLI overrides, feature flags, telemetry, and file locations.

Rayfin reads environment variables from the shell and from rayfin/.env. Only keys that start with RAYFIN_PUBLIC_ are projected to frontend .env.local files by rayfin env.

Frontend-visible variables

VariableDescriptionPopulated by
RAYFIN_PUBLIC_API_URLRayfin backend URL selected for development or deployment.rayfin dev, rayfin up
RAYFIN_PUBLIC_PUBLISHABLE_KEYPublic key for Rayfin SDK initialization.rayfin dev, rayfin up
RAYFIN_PUBLIC_FUNCTIONS_URLLocal Functions host URL selected by rayfin dev or rayfin dev functions apply; removed when Functions are disabled so clients do not retain a stale host.rayfin dev, rayfin dev functions apply
RAYFIN_PUBLIC_ITEM_IDFabric AppBackend item ID.rayfin up, deployment switch
RAYFIN_PUBLIC_WORKSPACE_IDFabric workspace ID.rayfin up, deployment switch
RAYFIN_PUBLIC_TENANT_IDEntra tenant ID.rayfin up, deployment switch
RAYFIN_PUBLIC_PORTAL_URLFabric portal base URL.rayfin up, deployment switch
RAYFIN_PUBLIC_SERVICE_MODEOptional app mode such as rayfin or mock.User-set
RAYFIN_PUBLIC_FRONTEND_PORTStable per-project frontend dev-server port. Reused while available and replaced when occupied.rayfin dev, rayfin up

Framework mapping

Source (rayfin/.env)ViteNext.jsPlain
RAYFIN_PUBLIC_API_URLVITE_RAYFIN_API_URLNEXT_PUBLIC_RAYFIN_API_URLAPI_URL
RAYFIN_PUBLIC_PUBLISHABLE_KEYVITE_RAYFIN_PUBLISHABLE_KEYNEXT_PUBLIC_RAYFIN_PUBLISHABLE_KEYPUBLISHABLE_KEY
RAYFIN_PUBLIC_FUNCTIONS_URLVITE_RAYFIN_FUNCTIONS_URLNEXT_PUBLIC_RAYFIN_FUNCTIONS_URLFUNCTIONS_URL
RAYFIN_PUBLIC_ITEM_IDVITE_FABRIC_ITEM_IDNEXT_PUBLIC_FABRIC_ITEM_IDITEM_ID
RAYFIN_PUBLIC_WORKSPACE_IDVITE_FABRIC_WORKSPACE_IDNEXT_PUBLIC_FABRIC_WORKSPACE_IDWORKSPACE_ID
RAYFIN_PUBLIC_TENANT_IDVITE_FABRIC_TENANT_IDNEXT_PUBLIC_FABRIC_TENANT_IDTENANT_ID
RAYFIN_PUBLIC_PORTAL_URLVITE_FABRIC_PORTAL_URLNEXT_PUBLIC_FABRIC_PORTAL_URLPORTAL_URL
RAYFIN_PUBLIC_SERVICE_MODEVITE_SERVICE_MODENEXT_PUBLIC_SERVICE_MODESERVICE_MODE
RAYFIN_PUBLIC_FRONTEND_PORTVITE_PORTPORTFRONTEND_PORT

Custom RAYFIN_PUBLIC_FOO maps to VITE_RAYFIN_FOO, NEXT_PUBLIC_RAYFIN_FOO, or FOO.

Frontend port aliases

RAYFIN_FRONTEND_DEV_PORT_ALIASES stores prior occupied frontend ports that should remain allow-listed while another process still owns them. The CLI manages this variable in rayfin/.env; do not set it by hand.

Tooling overrides

VariableDefaultDescription
RAYFIN_FABRIC_API_URLhttps://api.fabric.microsoft.com/v1Fabric REST API base URL. Non-Fabric proxy URLs are allowed but receive Fabric bearer tokens.
RAYFIN_FABRIC_PORTAL_URLhttps://app.fabric.microsoft.com/Fabric portal base URL for deep links and public env projection.
RAYFIN_ENV_FILErayfin/.envAlternate .env path. Equivalent to --env-file where supported.
RAYFIN_WORKSPACE_ID—Fabric workspace ID for non-interactive targeting by rayfin dev and rayfin up.
RAYFIN_TENANT_IDsigned-in tenantTenant used by rayfin up and rayfin dev when a flag is not supplied.
RAYFIN_TOKEN—Pre-acquired bearer token. Bypasses CLI login for the process.
RAYFIN_ENCRYPTION_FALLBACK_ENABLEDfalseAllows plaintext token cache storage when OS keychain encryption is unavailable.
RAYFIN_CONFIG_DIR~/.rayfinAuth, telemetry, and cache directory.
RAYFIN_APPINSIGHTS_CONNECTION_STRINGbuilt-in endpointOverrides telemetry endpoint for CLI and VS Code extension.
RAYFIN_TELEMETRY_OPTOUTunsetSet to 1 to disable CLI telemetry.
RAYFIN_TELEMETRY_ENVauto-detectedOverride telemetry environment label; values are trimmed/lowercased.
RAYFIN_FEATURE_FLAGSunsetComma-separated feature flags.

When RAYFIN_FABRIC_API_URL points at a non-Fabric host, the CLI sends the Fabric bearer token it acquired to that host on every REST call. Only use a trusted first-party proxy.

Shell-only variables

These are read from the shell and are not written to project files.

VariableDescription
RAYFIN_TOKENPre-acquired bearer token for headless use. Prefer service-principal login in CI unless another trusted system already minted a token.
RAYFIN_WORKSPACE_IDFabric workspace ID for non-interactive rayfin dev or rayfin up.
RAYFIN_TENANT_IDEntra tenant used when a tenant flag is not supplied.
RAYFIN_ENCRYPTION_FALLBACK_ENABLEDSet to true only after keychain encryption fails.
RAYFIN_CONFIG_DIROverrides the ~/.rayfin directory.
RAYFIN_TELEMETRY_OPTOUTSet to 1 to disable CLI telemetry.
RAYFIN_TELEMETRY_ENVOverrides telemetry environment labeling.

Recognized feature flags

FlagStatusEffect
storageExperimentalEnables Storage authoring prompts and the storage skill; also auto-enabled by services.storage.enabled: true.
functionsRemoved in 1.36No longer needed. Functions are GA in 1.36 and available without a feature flag.
connectorsRemoved in 1.36No longer needed. Connector commands are visible in 1.36 without a feature flag.

Internal rollout flags such as tools-arch-v2, up-legacy, cli-up-anonstatic, and cli-minor-fixes are not a user-facing docs surface for managed Fabric apps.

Resolution priority

For rayfin.yml interpolation and CLI env reads, values resolve in this order:

  1. Shell environment variables.
  2. Variables from --env-file <path> or RAYFIN_ENV_FILE.
  3. Variables from rayfin/.env.
  4. Hardcoded defaults or ${VAR:-default} interpolation defaults.

For Fabric API and portal overrides, shell variables win over rayfin/.env, which wins over persisted values in ~/.rayfin/auth.json, which wins over built-in defaults.

File locations

PathPurposeCommitted
rayfin/.envRuntime and deployment values, including RAYFIN_PUBLIC_*.No
rayfin/.env.examplePlaceholder documentation for expected variables.Yes
rayfin/.deployments.jsonRecorded Fabric deployments and active workspace.No
rayfin/rayfin.ymlProject configuration.Yes
rayfin/.lockfile.jsonManaged agent-files baseline.Yes
.env.local or frontend package .env.localFramework variables generated by rayfin env.No
rayfin/functions/local.settings.jsonLocal Functions runtime settings and local secret fallbacks.No
~/.rayfin/auth.jsonAuth state and environment overrides.N/A
~/.rayfin/cache.binMSAL token cache.N/A
~/.rayfin/dev-device-idAnonymous telemetry installation ID.N/A
PromptTrace Rayfin environment resolution
Find the value that my frontend will use for the Rayfin API URL. Check shell variables, rayfin/.env, and .env.local; explain which value wins according to Rayfin resolution priority; then run `npx rayfin env --framework vite` to regenerate .env.local if needed.
Something wrong on this page?Report an issueEdit this page

On this page