Deploying with rayfin up
Deploy a Rayfin project with rayfin up, including login, capacity readiness, targeting flags, dry runs, and deployment metadata.
Use rayfin up to publish a Rayfin project to Microsoft Fabric. It is the full production deploy command: it syncs backend settings, applies schema changes, builds static content, and deploys enabled Functions. Use rayfin dev for local iteration.
Note
For the exhaustive command reference, see rayfin up and rayfin login.
Prerequisites
- A Rayfin project with
rayfin/rayfin.yml. - A Microsoft account or service principal with access to a Fabric workspace.
- Fabric apps enabled for the tenant.
- Usable Fabric capacity on the target workspace, or permission for Rayfin to prepare one.
Sign in interactively
npx rayfin loginThe CLI opens a browser for Microsoft Entra ID sign-in and stores tokens with the operating system keychain. Check the current session at any time:
npx rayfin login statusIf the keychain is unavailable in a development container or similar environment, opt in explicitly:
npx rayfin login --encryption-fallback-enabledSign in for CI
Use service principal credentials when a browser prompt is not available:
npx rayfin login --service-principal \
--client-id <app-registration-client-id> \
--client-secret <secret> \
--tenant <tenant-id>Credentials persist for later commands in the same job.
You can also set RAYFIN_TOKEN to a pre-acquired bearer token for headless automation. Use this only when an external system already owns token acquisition; otherwise prefer rayfin login --service-principal so the CLI can manage tenant and audience details.
Run a full deploy
npx rayfin upIf you are not signed in, the command starts the interactive login flow.
What rayfin up does
- Reads
rayfin/rayfin.yml, interpolates env values, and validates local service inputs. - Resolves the target Fabric workspace from flags,
RAYFIN_WORKSPACE_ID, recorded deployments, or interactive selection. - Checks Fabric capacity readiness and prepares a workspace when needed.
- Chooses the Fabric item display name from
--item-nameoridinrayfin.yml. - Creates the App (preview) item on first deploy, or reuses the recorded item.
- Retrieves the publishable key.
- Resolves package versions (
packageVersions) for the deploy client and installed auth SDK. New in 1.35.1 - Syncs runtime settings from
rayfin.yml, including auth, static hosting access, Functions, storage flags, and connectors. - Generates connector configuration and function metadata required by enabled services.
- Applies the data schema generated from decorated entities.
- Builds and packages static content when
services.staticHosting.enabledis true and not excluded. - Uploads the static archive and records the hosting URL.
- Deploys Functions when
services.functions.enabledis true and not excluded. - Writes
rayfin/.deployments.json, mergesRAYFIN_PUBLIC_*values intorayfin/.env, and regenerates the frontend.env.localwhen possible.
When it finishes, the CLI prints the hosting URL when static content is deployed, a Fabric portal link, and deployment identifiers.
Note
Fabric brokered authentication with Microsoft Entra ID is the supported browser sign-in path. If your app needs sign-in, keep services.auth.fabric.enabled: true and include your local and deployed origins in allowedRedirectUris.
Target a workspace or item
| Flag | Description |
|---|---|
-w, --workspace <name> | Fabric workspace display name. |
--workspace-id <id> | Fabric workspace GUID. |
--workspace-uri <uri> | Fabric portal workspace URL; Rayfin derives the workspace ID and environment. |
--item-name <name> | Fabric item display name, defaulting to id in rayfin.yml. New in 1.36 |
-t, --tenant <id> | Entra tenant GUID. |
--env-file <path> | Env file used for interpolation and deployment values; defaults to rayfin/.env. |
Pass at most one workspace selector. --item-name changes the Fabric item display name for the deployment; runtime settings still come from rayfin.yml. After the item is recorded, later deploys reuse that item.
Prepare workspace capacity
Rayfin 1.36 can prepare a workspace and assign capacity during first deploys. New in 1.36
Readiness flow
- If the selected workspace already has usable capacity, Rayfin uses it and does not change the assignment.
- If no target is recorded or passed and the terminal is interactive, Rayfin asks:
Choose a Fabric workspace for this deployment:withUse new workspace [Recommended]andSelect existing workspace. - If a new workspace is selected, Rayfin creates a uniquely named workspace for the project and assigns capacity.
- If an existing workspace is selected, Rayfin uses the accessible-workspace picker.
- If a trial capacity is required, Rayfin may start or reuse an eligible Fabric trial capacity.
- If assigning a selected or trial capacity requires consent, Rayfin prompts with
Assign capacity <name> (<id>) to workspace <workspace>?. - With
--yes, deterministic assignment prompts are approved automatically. - With
--jsonor another non-interactive mode, Rayfin cannot ask questions. Provide explicit workspace targeting, or pass--capacity-idwhen capacity selection is required.
Capacity outcomes and exact messages
| Message | What to do |
|---|---|
--capacity-id must be a GUID. | Pass the Fabric capacity GUID shown in the Fabric portal. |
--workspace-id and --capacity-id cannot be used together. | Remove one option so Rayfin resolves either the workspace or the capacity. The same rule applies to --workspace and --workspace-uri. |
RAYFIN_WORKSPACE_ID and --capacity-id cannot be used together. | Unset RAYFIN_WORKSPACE_ID or remove --capacity-id. |
No workspace targeting context. Pass --workspace <name> (or --workspace-id <id> / --workspace-uri <url>), or run \rayfin up` once interactively to record a deployment.` | Provide a workspace target for non-interactive deployment. |
Provisioning and assigning Fabric trial capacity to workspace <name> requires confirmation. | Rerun with --yes, run interactively, or pass a workspace that already has capacity. |
Multiple premium Fabric capacities are available and require interactive selection. | Run interactively to choose a capacity, or pass --capacity-id <id> without a workspace option. |
Ignoring --capacity-id because an existing deployment keeps its current workspace capacity. | Omit --capacity-id, or deploy to a different workspace if you need a different capacity. |
Do not combine --capacity-id with --workspace, --workspace-id, --workspace-uri, or RAYFIN_WORKSPACE_ID; the CLI validates this in the shared capacity option checker before deployment.
Preview without deploying
npx rayfin up --dry-run --workspace-id <workspace-guid>Dry run validates local inputs and resolves the workspace without deploying or modifying resources. Changed in 1.36
Dry run does:
- Validate static-hosting paths and access posture; reports that a non-interactive deploy would default missing static-hosting posture to
assetAccess: protectedand write it torayfin.yml. New in 1.35.1 - Resolve package versions that a deploy would declare.
- Authenticate and make read-only Fabric requests needed to resolve the workspace.
- Print the planned operations and target workspace.
Dry run does not:
- Run build commands.
- Create Fabric items.
- Apply runtime settings or schemas.
- Upload static content.
- Deploy Functions.
- Write
rayfin/.deployments.json,rayfin/.env, or.env.local.
Skip specific deployment phases
Use --exclude-services <names> for scripts that intentionally run the deploy workflow while skipping selected build/package/deploy phases.
| Value | Effect |
|---|---|
staticHosting | Skips static build, package, and upload. Runtime settings still sync. |
functions | Skips Functions deployment. Runtime settings still sync. New in 1.36 |
npx rayfin up --exclude-services staticHosting
npx rayfin up --exclude-services functionsThis is not the normal local development loop. Use npm run dev for that.
Deploy schema, static content, or Functions only
| Command | What it updates |
|---|---|
npx rayfin up db apply | Data schema only. |
npx rayfin up db apply --force | Allows destructive schema changes after review. |
npx rayfin up staticapp deploy | Static content only. |
npx rayfin up staticapp deploy --skip-build | Uploads existing static output without running the build command. |
npx rayfin up functions deploy | Functions only. Changed in 1.36 |
Enabled Functions require application authentication in rayfin.yml before deploy:
services:
functions:
enabled: true
auth:
type: applicationSee Functions for authoring and authentication details.
Deployment metadata
rayfin/.deployments.json records deployments by workspace and is not committed to source control:
{
"active": "team-apps",
"deployments": {
"team-apps": {
"fabricItemId": "7db00cb9-f630-4ecf-8fc9-942e60af5d78",
"itemName": "my-team-app",
"fabricWorkspaceId": "8b17cf64-3c12-46ac-a572-192732c32641",
"fabricTenantId": "00000000-0000-0000-0000-000000000000",
"publishableKey": "pk-nua-EHihY2jz71V65YB4",
"fabricPortalUrl": "https://app.fabric.microsoft.com/",
"hostingUrl": "https://silky-sand-4924b3ad1f-centraluseuap.webapp.rayfingwdev.com",
"deployedAt": "2026-04-28T01:15:50.514Z"
}
}
}The matching RAYFIN_PUBLIC_* values are merged into rayfin/.env, and rayfin env maps them into framework-specific names such as VITE_RAYFIN_API_URL.
Manage multiple deployments
Use separate workspaces for dev, test, and production. A single checkout can record multiple deployments:
npx rayfin up list
npx rayfin up switch team-apps
npx rayfin up switch --workspace-id <workspace-guid>up switch rewrites rayfin/.env for the selected deployment and regenerates the frontend .env.local unless --no-emit-env is set. If the active sign-in tenant differs from the deployment tenant, the command warns so you can run npx rayfin login with the right account.
Check deployment status
npx rayfin up status
npx rayfin up status --jsonThe status check verifies authenticated management access to the Fabric item. It does not validate every application route or function.
When static content is deployed, human-readable output includes:
Static app: https://silky-sand-4924b3ad1f-centraluseuap.webapp.rayfingwdev.comJSON output exposes the same value as deployment.hostingUrl:
{
"deployment": {
"hostingUrl": "https://silky-sand-4924b3ad1f-centraluseuap.webapp.rayfingwdev.com"
}
}When no static app URL is recorded, the line is omitted and deployment.hostingUrl is null.
Sign out
npx rayfin logoutCommon flags
This table covers the flags used most often in guides and automation. See rayfin up for the exhaustive list.
| Flag | Use it when |
|---|---|
-w, --workspace <name> | Target a Fabric workspace by display name. |
--workspace-id <id> | Target a Fabric workspace by GUID. |
--workspace-uri <uri> | Target a workspace from a Fabric portal URL. |
--item-name <name> | Use a Fabric item display name other than id from rayfin.yml. New in 1.36 |
--capacity-id <id> | Assign a specific Fabric capacity when the target workspace has no usable capacity. New in 1.36 |
-n, --dry-run | Validate local inputs and resolve the workspace without deploying or modifying resources. Changed in 1.36 |
--exclude-services <names> | Skip supported deploy phases (staticHosting, functions) while runtime settings still sync. |
--env-file <path> | Use a file other than rayfin/.env for interpolation and deployment values. |
--force | You reviewed destructive schema operations and accept the data loss. |
--json | A script needs structured deployment output. |
-y, --yes | A non-interactive run should accept deterministic prompts such as capacity assignment and item reuse. |
-v, --verbose | You need detailed logs for a failed deploy. |
--encryption-fallback-enabled | The OS keychain is unavailable in a development environment. |
Inspect my Rayfin project and decide whether to run a full `npx rayfin up`, `npx rayfin up db apply`, `npx rayfin up staticapp deploy`, or `npx rayfin up functions deploy`. Explain the target workspace and item from rayfin/.deployments.json, run the chosen command, and finish with `npx rayfin up status --json`.Troubleshooting
See Deployment troubleshooting for exact CLI error text.