Rayfin

rayfin up

Deploy a Rayfin project to Fabric, resolve workspace and capacity, apply schema and settings, and run deploy-only up subcommands.

rayfin up deploys the project to Microsoft Fabric as a Rayfin item. It applies rayfin.yml runtime settings, applies Data schema and Storage folder declarations, deploys Functions when enabled, and builds and deploys static hosting unless excluded.

npx rayfin up

What it does

  1. Validates local inputs before any remote call. Since 2.0 that includes connector additionalPayload blocks, custom audiences declared on Functions, and the dynamic claims contract, which is regenerated from the udf.authClaims provider. A failure stops the deploy before anything changes in Fabric. New in 2.0
  2. Resolves the target workspace from flags, RAYFIN_WORKSPACE_ID, recorded deployments, or prompt.
  3. Creates or reuses a Fabric AppBackend item.
  4. Applies runtime settings from rayfin.yml.
  5. Applies the Data API Builder configuration when services.data.enabled: true.
  6. Applies Storage folder declarations when services.storage.enabled: true. Changed in 2.0
  7. Writes rayfin/.deployments.json and public values in rayfin/.env.
  8. Applies declared connector configuration.
  9. Builds static hosting when enabled and not excluded, and uploads it unless nothing changed since the last successful deployment. New in 2.0
  10. Builds and deploys Functions when services.functions.enabled: true, then updates the stored dynamic claims contract if the deployed provider changed it. New in 2.0

Options

OptionDefaultDescription
-t, --tenant <id>signed-in tenantEntra ID tenant GUID.
-w, --workspace <name>My Workspace when no other target is recordedFabric workspace display name, resolved to an ID.
--item-name <name>project id in rayfin.ymlFabric item display name. New in 1.36
--workspace-id <id>—Fabric workspace GUID to deploy into.
--capacity-id <id>—Fabric capacity ID to assign when the target workspace has no usable capacity. New in 1.36
--workspace-uri <uri>—Fabric portal workspace URL, for example https://app.fabric.microsoft.com/groups/<id>/list; derives workspace ID and environment.
--forcefalseAllow destructive data schema changes that may result in data loss. When Storage is enabled, it also lets Storage remove undeclared folders that still contain objects.
-n, --dry-runfalseValidate local inputs and resolve the workspace without deploying or modifying resources. Changed in 1.36
--env-file <path>rayfin/.env.env file containing Fabric app properties and interpolation variables.
-v, --verbosefalseEnable verbose output.
--jsonfalseOutput deployment result as JSON.
-y, --yesfalseAuto-accept confirmation prompts.
--encryption-fallback-enabledfalseAllow plaintext token storage when the OS keychain is unavailable.
--exclude-services <names>—Comma-separated services to skip during deployment. Supported: staticHosting, functions. Runtime settings remain unchanged. functions is new in 1.36. Changed in 1.36
--force-static-deployfalseUpload static content even when it is unchanged since the last successful deployment. New in 2.0
--provider <provider>fabricReserved; only fabric is supported.

Warning

--force permits destructive schema changes and the removal of non-empty Storage folders. Review what can be dropped before passing it.

Skip unchanged static content

New in 2.0

A full rayfin up still runs the static build, then compares a fingerprint of the built files, workspace, item, backend URL, and publishable key with the one recorded for the last successful static deployment. When they match, it skips the upload, keeps the recorded hosting URL, and prints:

ℹ️  Static app re-deployment skipped: the built static files, workspace, and backend are unchanged since the last successful deployment.
   To upload it anyway, run `rayfin up --force-static-deploy`.

With --json, the result includes staticHostingSkip with reason and hint fields. Pass --force-static-deploy to upload anyway. rayfin up staticapp deploy always uploads.

Plan before deploying

Use --dry-run when an agent or CI job needs to prove the local project and target workspace are valid without changing Fabric resources.

npx rayfin up --workspace "My Workspace" --dry-run

Since 1.36, a dry run validates local inputs and resolves the workspace. It does not deploy, apply schema, modify runtime settings, upload Functions, upload static content, or write a new Fabric item.

Use JSON for automation:

npx rayfin up --workspace-id <workspace-id> --dry-run --json

Deploy only selected services

--exclude-services skips only the build/package/deploy phase for the named service. The CLI still applies runtime settings from rayfin.yml, so backend service configuration does not drift.

ExampleWhat it does
npx rayfin up --exclude-services staticHostingApplies backend settings, Data schema, and Storage declarations, but does not build or upload static assets.
npx rayfin up --exclude-services functionsApplies backend settings, Data schema, Storage declarations, and static hosting, but does not package or upload Functions.
npx rayfin up --exclude-services staticHosting,functionsApplies backend state only.

Prefer rayfin dev for the interactive local loop. Keep --exclude-services for scripts that need a deploy without one or more artifact uploads.

up status

npx rayfin up status

Displays cloud deployment status.

OptionDefaultDescription
--jsonfalseOutput status in JSON format.
-v, --verbosefalseEnable verbose output.

up status exits 0 when the recorded deployment is healthy. It exits non-zero when no deployment is recorded, the endpoint is unreachable, or authentication fails. Use --json when a script needs to branch on the returned status instead of parsing formatted text.

up list

npx rayfin up list

Lists Fabric deployments recorded in rayfin/.deployments.json.

OptionDescription
--jsonOutput as JSON.

up switch

npx rayfin up switch [workspace]

Switches the active recorded deployment and rewrites rayfin/.env.

OptionDescription
[workspace]Workspace name or slug to activate.
--workspace-id <id>Activate by Fabric workspace ID.
-l, --listList recorded deployments instead of switching.
--no-emit-envSkip framework .env.local regeneration.

up db apply

npx rayfin up db apply [--force]

Generates and applies Data API Builder configuration to the remote Rayfin item workload endpoint.

OptionDefaultDescription
-v, --verbosefalseEnable verbose output.
--forcefalseAllow destructive schema changes that may result in data loss.
--jsonfalseOutput result as JSON.
--drift-file <path>~/.rayfin/driftSave detected schema drift CSV at this path. New in 2.0
--overwritefalseReplace the --drift-file if it already exists. New in 2.0
--skip-drift-checkfalseSkip the schema drift check (escape hatch if it blocks an unchanged database). New in 2.0

up storage apply

New in 2.0

npx rayfin up storage apply [--force]

Generates and applies Storage configuration to the remote Rayfin item workload endpoint, without running the rest of the deploy. Use it to retry Storage after a full rayfin up reported a Storage warning, or to deploy only folder changes. In 1.36 this subcommand was experimental and registered only when the storage feature flag was on (RAYFIN_FEATURE_FLAGS=storage or services.storage.enabled: true).

OptionDefaultDescription
--forcefalseForce the storage controller to accept configuration that may result in data loss.
--jsonfalseOutput result as JSON.

The subcommand needs an existing deployment record from rayfin up and Data enabled in rayfin.yml. It applies the @blob folders registered in rayfin/storage/schema.ts; when none are declared, it prints ⚠️ No @blob folder declarations found. Storage configuration was not applied. See Storage for folder declarations.

Warning

Removing a folder declaration makes that folder unavailable as soon as the apply succeeds, and permanently deletes its objects and metadata in the background. When a removed folder still contains objects, the apply stops with Storage apply blocked (409) until you pass --force.

up staticapp deploy

npx rayfin up staticapp deploy

Builds, packages, and deploys static content to the remote Rayfin item. Unlike a full rayfin up, it uploads even when the content is unchanged.

OptionDefaultDescription
-v, --verbosefalseEnable verbose output.
--skip-buildfalseSkip the build command and deploy existing content.
--jsonfalseOutput result as JSON.

up functions deploy

Changed in 1.36

npx rayfin up functions deploy

Builds, packages, and deploys Functions to the remote Rayfin item. See rayfin functions. After the code deploys, it updates the stored dynamic claims contract when the udf.authClaims provider changed it, and clears the stored contract when the provider was removed. New in 2.0

Note

Functions are not available in every Fabric region or tenant.

OptionDefaultDescription
-v, --verbosefalseEnable verbose output.
--skip-buildfalseSkip the build command and deploy existing content.
--jsonfalseOutput result as JSON.

up connector apply

Changed in 1.36 Preview

npx rayfin up connector apply [--name <name>]

Generates and applies Data API Builder configuration for declared GraphQL connectors. See Connector.

OptionDefaultDescription
--name <name>all connectorsApply only the named connector.
-v, --verbosefalseEnable verbose output.
--jsonfalseOutput result as JSON.

Managing secrets

Secrets are managed by the top-level rayfin secret command, not by rayfin up. They target the same deployed workload endpoint that rayfin up records.

npx rayfin secret set API_KEY --describe="API key used by payment functions"
npx rayfin secret list

Secret values are stored in the deployed Rayfin item. rayfin.yml stores only the metadata declaration used for typing and documentation.

Troubleshooting

MessageMeaningFix
RAYFIN_WORKSPACE_ID and --capacity-id cannot be used together.Capacity assignment requires Rayfin to select or create a workspace, but an ambient workspace was already fixed.Unset RAYFIN_WORKSPACE_ID, or remove --capacity-id.
Dialect is required when Data module is enabledservices.data.enabled is true but services.data.dialect is missing.Set services.data.dialect: mssql.
Invalid services.functions.auth: authentication is required when Functions are enabled. Set services.functions.auth.type to "application".Functions are enabled without the required 1.36 auth block.Add services.functions.auth.type: application.
No remote endpoint configured. Run `rayfin up` first to deploy and register connectors.A deploy-only subcommand needs an existing deployment record.Run npx rayfin up once, then retry the subcommand.
Storage requires the Data service.services.storage.enabled is true but Data is not enabled.Enable services.data, or disable services.storage.
Storage configuration was not applied: <reason>. Run `rayfin up storage apply` to retry.The rest of the deploy continued, but the Storage step failed for a reason other than a blocked folder removal.Fix the reported reason, then run npx rayfin up storage apply.
Storage apply blocked (409): the following folder(s) are no longer declared but still contain objects and were not removed:A folder you removed from the schema still holds objects.Restore the declaration, or rerun with --force to delete the folder and its objects.
connectors block in rayfin.yml has validation errors:A connector entry is invalid. An additionalPayload on a Category A connector, or one over 64 KiB or nested deeper than 32 levels, stops the deploy before any remote call. Changed in 2.0Fix the listed entries. --json output includes the invalid-connectors code and a hint.
'<audience>' is not a valid custom audience. Use an application ID (GUID) or an https:// or api:// resource URI without a scope, query, or wildcard.A Functions connection declares an invalid custom audience. The deploy stops before any remote call. New in 2.0Use an application ID or a resource URI. See Connections.
services.auth.dynamicClaims.enabled is true, but services.functions is not enabled.Dynamic claims need a deployed udf.authClaims provider. New in 2.0Enable services.functions, or set services.auth.dynamicClaims.enabled: false. See Dynamic claims.
PromptDeploy without publishing Functions
Run `npx rayfin up --exclude-services functions --dry-run` in my Rayfin project to verify the target workspace and local configuration, then run `npx rayfin up --exclude-services functions` to deploy everything except the Functions package.
PromptDeploy only Storage folder changes
In my Rayfin 2.0 project I changed the @blob folders registered in the schema array of rayfin/storage/schema.ts. Run `npx rayfin up storage apply --json` against the recorded deployment. If it fails with "Storage apply blocked (409)", list the folders it would remove and ask me before rerunning with --force, because removing a folder permanently deletes its objects.
Something wrong on this page?Report an issueEdit this page

On this page