Rayfin

Deploying functions

Deploy Rayfin functions with rayfin up, deploy only function code, skip function deploys, and understand deploy-time packaging.

Changed in 1.36

Deploy functions after changing server-side code, generated metadata, or the functions package dependencies.

Note

Functions are generally available in Rayfin 1.36 and are not available in every Fabric region or tenant.

Configure the service

Enabled Functions require application authentication:

rayfin/rayfin.yml
services:
  functions:
    enabled: true
    path: rayfin/functions
    auth:
      type: application
    buildCommand: npm run build

New 1.36 scaffolds write this block. Existing apps must add auth.type: application explicitly.

Deploy with the whole app

npx rayfin up

A full deploy validates services.functions.auth.type, applies runtime settings, builds the functions package with services.functions.buildCommand, generates metadata, packages the functions, and uploads them with the rest of the app.

Use this standard workflow after enabling Functions or changing application authentication:

  1. Sign in if needed.

    npx rayfin login
  2. Deploy the whole app.

    npx rayfin up
  3. Check the active deployment.

    npx rayfin up status

Redeploy with npx rayfin up after changing function code when you want schema, settings, static content, and functions to move together.

If Functions are enabled but auth is missing, full deploy fails with:

Invalid services.functions.auth: authentication is required when Functions are enabled. Set services.functions.auth.type to "application".

If auth.type is unsupported, it fails with:

Invalid services.functions.auth.type: found "<value>". Only application authentication is supported. Set services.functions.auth.type to "application".

Deploy only functions

npx rayfin up functions deploy
OptionDescription
-v, --verboseEnable verbose output.
--skip-buildDeploy existing build output without running the build command.
--jsonOutput the result as JSON.

Use this when the remote app already exists and you only need to upload function code. It does not validate or apply services.functions.auth.type to the remote app. After changing the auth mode in rayfin.yml, run a full npx rayfin up.

Skip functions during a full deploy

npx rayfin up --exclude-services functions

--exclude-services accepts functions and staticHosting. Runtime settings remain unchanged; only the selected build/package/deploy phase is skipped. New in 1.36

How functions are packaged

Rayfin 1.36 packages functions as a deploy artifact that includes generated deploy metadata and runtime metadata. By default, the CLI bundles the functions project with esbuild so workspace-hoisted dependencies and sibling packages are included in the uploaded ZIP.

Deploy packaging excludes local-only and build-noise files such as local.settings.json, node_modules, bin, obj, source maps, coverage, and editor folders. local.settings.json is never deployed because it can contain local secrets.

The local functions host.json extension bundle range affects only Core Tools local development. During deploy, rayfin up substitutes the CLI's assets/functions/host.deploy.json; in Rayfin 1.36.x that deploy file uses the stable Microsoft.Azure.Functions.ExtensionBundle range [4.38.1, 5.0.0). Updating local host.json to [4.49.0, 5.0.0) for Rayfin 1.36.2 does not change deployed host settings. Changed in 1.36.2

The CLI also ensures rayfin/functions/src/secrets.generated.ts exists before the build, so handlers that read ctx.Secrets.<NAME> compile in fresh clones and CI.

Validate deploy-ready packages

The deploy validator checks for required files such as package.json and host.json, compatible worker metadata support, and portable dependencies. If validation fails, the CLI starts the error with:

Cannot deploy: <functions-path> is not deploy-ready.

Fix each of the following before retrying:

Run npx rayfin functions init if the package is missing, or update the functions package dependencies if the worker version is incompatible.

PromptDeploy Rayfin functions
In my Rayfin project, deploy functions to the Fabric app. Confirm rayfin/rayfin.yml has services.functions.enabled: true and services.functions.auth.type: application. If the auth block was added or changed, run a full `npx rayfin up` so the remote app settings are applied. If only function code changed and the app is already configured, run `npx rayfin up functions deploy`. Do not deploy local.settings.json or any secret values. If deployment fails, capture the exact error text and inspect rayfin/functions/package.json, host.json, buildCommand, and worker package compatibility before retrying.
Something wrong on this page?Report an issueEdit this page

On this page