Rayfin

Known limitations

Current constraints in Rayfin 2.0 — service availability, functions, connectors, the data client, Data API Builder, relationships, auth, and schema apply — each with a workaround.

This page lists the current constraints Rayfin builders run into most often, grouped by area. Each entry names the limitation and the workaround to use instead — if you're an agent generating Rayfin code, check the relevant section here before you write entities, queries, permission decorators, functions, or connectors.

Service availability

Functions are not available in every region or tenant

Functions are generally available as of Rayfin 1.36 — no feature flag is needed — but the service is not available in every Fabric region or tenant.

Workaround: deploy a minimal app with services.functions.enabled: true and confirm npx rayfin up succeeds in your target workspace before you design around it. Keep data access in client.data.<Entity> where a function is not strictly required.

Storage has no local service

Changed in 2.0

Storage is generally available in 2.0 and needs no feature flag, but it is remote-only. There is no local Storage service or emulator: rayfin dev applies your folder declarations to the remote Fabric backend, and uploads and downloads always go to OneLake. Storage also requires the Data service.

Workaround: use a development workspace for Storage work, and run npx rayfin dev storage apply to retry only the Storage configuration during a development session.

Dynamic auth claims depend on the workspace's region

New in 2.0

The backend must have dynamic auth claims enabled for the workspace's region. Until it does, sign-in and refresh mint base claims only and never call your udf.authClaims provider.

Workaround: after deploying, sign in and confirm client.auth.getClaims() returns your app-defined claims before you write policies that depend on them.

Raw SQL and Observability need service-side enablement

New in 2.0 Experimental

Raw SQL in functions runs only where the service has enabled it for your tenant, and never under rayfin dev. Observability provisions and queries an Application Insights resource only when Fabric has enabled the telemetry service for the workspace.

Workaround: prefer ctx.getDataClient() for data access in functions, and verify both features against a deployed app in your target workspace before you depend on them.

Deep linking is rolling out per tenant

Deep linking depends on the Fabric portal, and it is not available in every tenant yet.

Workaround: call isSupported() before you show a share button or rely on the URL carrying state, and keep the app fully usable when it resolves to undefined.

Functions

Function connections run only as the app identity

Changed in 1.36

A deployed function's ctx.Tokens.<Audience> token belongs to the app identity — for current Fabric apps, the owner of the Fabric app item — not to the signed-in user. services.functions.auth.type accepts only application, so a function cannot call an external resource as the caller.

Workaround: grant the app identity access to each resource the function calls. When each user must see only their own data at the source, query it through a SQL or semantic model connector with auth.type: delegated instead of a function. Data your app owns stays caller-scoped through ctx.getDataClient(). See Delegated and application access.

Local function connections use your own identity

When rayfin dev runs Functions locally, ctx.Tokens holds tokens for the account you signed in with, not for the app identity. A call that works locally can fail after rayfin up with an authorization error.

Workaround: grant the app identity access before you deploy, and test the deployed function once with npx rayfin up.

Five built-in audiences

Changed in 2.0

AudienceType has five members: Sql, Storage, Fabric, AzureAI, and ADO. CosmosDB, KeyVault, EventGrid, Kusto, and WorkIQ were removed in 1.36. Since 2.0 you can also declare a custom audience — an application ID or an https:// or api:// resource URI — for any other Entra-protected resource.

Workaround: for another Entra-protected API, declare it as a custom audience and grant the app identity access to it. For a service that accepts key-based access, store the credential with npx rayfin secret set and read it from ctx.Secrets in the function. See Secrets in functions.

Connectors

Connectors do not run under rayfin dev

rayfin dev reads the connectors: block but does not wire it, so connector calls do not work in a development session until the connector is deployed.

Workaround: deploy with npx rayfin up (or npx rayfin up connector apply) and test against the deployed app. Prove the connector returns rows with rayfin connector invoke or rayfin connector inspect before you build UI on it.

New Eventhouse connectors cannot be added

Changed in 2.0

The Kusto connector type was renamed to eventhouse in 2.0, and it is still held back: rayfin connector add, types, and search reject it with Connector type "eventhouse" is not available in this release. A type: kusto entry is now an unknown connector type. A project that already declares an Eventhouse connector keeps validating and deploying once its entry uses type: eventhouse, auth.type: application, and saved queries in additionalPayload.

Workaround: migrate an existing Kusto declaration by hand as Eventhouse describes. For new projects, query relational Fabric sources through a SQL connector instead.

rayfin connector inspect does not support Eventhouse

connector inspect works for fabric-sqlanalytics, fabric-warehouse, fabric-sqldatabase, and fabric-semanticmodel. An eventhouse connector fails with Unsupported connector type: eventhouse.

Workaround: after npx rayfin up, call every saved query once from a test page in the deployed app. See Eventhouse.

Install connector packages at the pinned version

An unversioned install of a connector package can resolve to a different release than the rest of your Rayfin packages. The connector then pulls its own @microsoft/rayfin-data, leaving two Rayfin version lines in one app.

Workaround: run the version-pinned npm install that rayfin connector add prints, verbatim, so every @microsoft/rayfin-* package stays on one version.

Decorated entity classes can break a browser bundle

Changed in 2.0

connectorConfig.entities accepts either an entity's class or a string array of its field names. The class form is required to select a relationship — selecting one with the array form throws ENTITIES_REQUIRED_FOR_RELATIONSHIP_SELECT. Importing the class puts TC39 decorators in the browser bundle, and @vitejs/plugin-react-swc does not compile them by default: the dev server reports Expression expected at @entity(), and a Vite 8 build can emit raw @decorator syntax that rayfin up refuses with The built bundle is not parseable JavaScript.

Workaround: enable Stage 3 decorators in the SWC plugin, as the 2.0 templates do, or use the default @vitejs/plugin-react plugin. See Enable decorators in the SWC plugin. If neither is possible, list each entity's fields as a string array unless you need relationship selects.

Data client

Results contain only the fields you select

Changed in 2.0

A query returns only the fields it requests, and 2.0 types reflect that. A query without .select() — including findById(), findMany(), and findFirst() on the entity client — requests the primary key only. Selected Date fields are typed Date | string and booleans boolean | 'true' | 'false', because values can arrive as wire strings.

Workaround: select every field you read, for example client.data.Todo.select(['id', 'title']).where({ id: { eq: id } }).findFirst(), and convert date and boolean values explicitly. See Querying.

count() counts numeric values, not rows

The fluent GraphQL client has no count() method on the query chain. count exists only as an aggregation operation, and Data API Builder types every aggregation's field argument as the entity's numeric fields — so count can only target a numeric column, and returns the number of rows where that column is non-null.

Workaround: point count at a non-nullable numeric column when the entity has one. Otherwise select the minimal set of fields you need and use results.length, or page through results with .executePaginated() and sum items.length per page if the total exceeds one page.

Grouped aggregation cannot be combined with row selection

Data API Builder rejects a query that requests groupBy and items together, so .aggregate(...) is mutually exclusive with .select(), .orderBy(), .first(), and .after(). Each combination is a compile-time error backed by a runtime guard.

Workaround: run the aggregation on its own and sort or slice the returned array in TypeScript. One row per group is normally a small result.

Many-to-many relationships are not supported

@one() and @many() model one-to-many and many-to-one relationships only — there is no decorator for many-to-many.

Workaround: create an explicit join entity with two @one() fields, one pointing at each side of the relationship. See Relationship decorators.

Data API Builder (DAB)

Rayfin's data layer generates configuration for Data API Builder, so some limitations come from DAB itself rather than from Rayfin's client or decorators.

Collection queries return only one page unless you paginate

.execute() returns a single page — 100 records by default, up to a maximum page size of 100,000 — with no signal that more records exist. A query that matches more rows than the page size is silently truncated.

Workaround: use .first(n) with .executePaginated() and .after(endCursor) for any list that can exceed one page. See Pagination and Errors and troubleshooting.

Total record counts are unsupported

There is no way to request a total row count independent of a page (DAB discussion #2234, DAB issue #2369) — this is also why PagedResult.totalCount exists on the type but is never populated.

Workaround: don't rely on totalCount. If you need an approximate count, select minimal fields and iterate pages with .executePaginated(), summing items.length.

Backward pagination (before) is unsupported

DAB only supports forward pagination — first and after (DAB issue #2238). There is no before / last equivalent on the fluent client.

Workaround: design paged UI around forward-only navigation (a "next page" cursor kept in state), rather than jumping backward by cursor.

Selections support one relationship level

Changed in 2.0

Each .select() path supports one relationship followed by a scalar field: 'notebook.name' for a to-one relationship and 'notes[].title' for a to-many relationship. Deeper paths such as 'notebook.owner.email', bare relationship names, and object-valued leaves are rejected before the request is sent. A to-many path without the [] marker no longer requests the relationship's items connection.

Workaround: issue a second query for the deeper relationship using the first query's result as the filter, or add a direct field or relationship on the entity that needs the deeper data. Connector entities are not limited this way: their dotted paths can go deeper.

Relationships

Foreign key columns are auto-generated

Defining @one() or @many() already creates the underlying foreign key column — you don't need (and normally shouldn't) declare it yourself.

Workaround: only declare a foreign key field explicitly when your application code needs to read or set the raw ID value directly.

Foreign keys must use the {property}_id naming convention

When you do declare a foreign key field, it must be named {property}_id to match the relationship. Custom key names (foreignKey, targetKey) are not supported on relationship decorators.

Workaround: name the field after the relationship property plus _id — for a @one(() => Category) category field, the FK column is category_id.

@one() / @many() only accept { optional?, unique? }

Relationship decorators don't accept the full field option set (no default, max, min, etc.) — only optional (nullable relationship) and unique (make a @one() relationship one-to-one).

Workaround: if you need constraints beyond nullability and uniqueness, apply them to the plain field decorator on a manually-declared foreign key column instead of the relationship decorator.

Auth

The callback is onSessionChange, not onAuthStateChange

onAuthStateChange does not exist on the Rayfin auth client, despite being a common name in other auth SDKs.

Workaround: subscribe with auth.onSessionChange(callback), which returns an unsubscribe function. See @microsoft/rayfin-auth.

Session objects are opaque

OpaqueSession intentionally doesn't expose tokens or internal claim structure.

Workaround: gate UI logic on session.isAuthenticated or the presence of session.user — don't try to read or decode internal session fields. To read claims, call client.auth.getClaims(). New in 2.0

isAuthenticated is false while the access token is expired

Changed in 2.0

isAuthenticated is true only while the session's access token is unexpired. If the token lapses before it can be renewed — for example while the device is offline — isAuthenticated reads false while user stays set, and the SDK renews the token when it can.

Workaround: gate authenticated API calls on isAuthenticated, and use session.user when you only need to show who is signed in. See Sessions.

Client-side claims are strings

New in 2.0

Tokens carry every app-defined claim as a string, so client.auth.getClaims() returns a provider's false as 'false' and 42 as '42'.

Workaround: compare with === 'true' or parse the value, and keep authorization decisions in server-side policies. In a function, ctx.getClaims() returns the declared types.

Auth config changes require a backend restart

Enabling or disabling auth (or changing its settings) in rayfin.yml doesn't take effect on a running backend.

Workaround: restart npm run dev (which runs rayfin dev) during development, or redeploy with npx rayfin up, after any services.auth change in rayfin.yml.

Data

@entity() doesn't accept composite field constraints

There's no class-level option for constraints that span multiple fields (e.g., "field A must be less than field B").

Workaround: define constraints on individual fields via their own field decorator options (min, max, regex, and so on); enforce cross-field constraints in application code or with toStandardSchema before calling create / update.

Prefer @anonymous() / @authenticated() over @role('anonymous' | 'authenticated', ...)

The shorthand decorators are clearer at the call site than the general-purpose @role() form.

Workaround: use @authenticated(actions, options) for authenticated-only access, and @anonymous(actions, options) for public access. Both are exported from the package root. Anonymous access on a deployed Fabric app additionally requires a tenant administrator to turn on Enable anonymous data access for Fabric Apps (Preview) for the app owner; without it, applying the schema fails with HTTP 403 ANONYMOUS_DATA_ACCESS_BLOCKED_BY_TENANT_ADMIN. See Permissions and Permission decorators.

Property names must be valid GraphQL field names

Changed in 2.0

An entity property becomes a GraphQL field, so its name must match /^[_A-Za-z][_0-9A-Za-z]*$/ and must not start with __. The CLI rejects names such as $price or my-col during schema analysis, before anything is applied. This applies to relationship properties and connector entities too.

Workaround: give the property a valid name and map it to the column with the column option, for example @decimal({ column: '$price' }) price!: number;.

Database and schema apply

Run rayfin up before rayfin up db apply

rayfin up db apply applies schema to an app that already exists in Fabric.

Workaround: run npx rayfin up once to create the app, then use the db apply subcommand for schema-only changes.

Schema compilation needs TypeScript 5.7.2 or later

Changed in 2.0

The CLI compiles your entities with your app's TypeScript and supports ^5.7.2 || ^6.0.2. TypeScript 5.0 through 5.7.1, 6.0.0, 6.0.1, prereleases, and 7.x are rejected.

Workaround: update TypeScript in the package that holds your schema, for example npm install --save-dev "typescript@^5.7.2", and commit the manifest and lockfile.

Relative imports under rayfin/ need .js extensions

Node.js loads the compiled entities as ES modules, so an extensionless relative import such as import { Category } from './Category' fails with TS2835. Since 2.0, rayfin init adds rayfin/package.json with {"type": "module"} to apps that are not ES modules, which also makes rayfin/ its own package: root imports aliases and self-references by package name do not resolve inside it. Changed in 2.0

Workaround: write import { Category } from './Category.js', keep rayfin/package.json, and use relative imports inside rayfin/. See Project structure.

Entity names can't reuse GraphQL built-in type names

Changed in 1.36

An entity name becomes a GraphQL type name. Names such as Date, DateTime, String, Int, Decimal, UUID, Query, Mutation, and Subscription collide with types the generated schema already defines, as does any name that starts with __. Before 1.36 the deploy failed with an opaque schema-build error. Since 1.36 the CLI rejects the name up front — for example Entity name 'Date' is a built-in GraphQL scalar type reserved by the platform, or Reserved GraphQL type names detected in connector entities: for connectors. This applies to your own entities and to connector entities.

Workaround: rename the class — for example EventDate instead of Date — or keep the class name and pass a different entity name with @entity('EventDate'). For a connector entity, keep Source({ table: '...' }) pointing at the original table.

dialect is required when the Data module is enabled

Setting services.data.enabled: true in rayfin.yml without a dialect fails at deploy time with Dialect is required when Data module is enabled.

Workaround: always pair data.enabled: true with dialect: mssql — the only dialect Fabric apps support. See Errors and troubleshooting.

@text() without max breaks GraphQL schema generation on MSSQL

Omitting max on a @text() field produces an NVARCHAR(MAX) column on MSSQL. Rayfin's metadata provider can fail to build a GraphQL schema from that column, which surfaces as an "Internal server error" at runtime — after rayfin up itself reported success.

Workaround: always set @text({ max: N }) with an explicit length on every string field targeting MSSQL. See Errors and troubleshooting and the @text() field options on the rayfin-core reference.

Something wrong on this page?Report an issueEdit this page

On this page

Service availabilityFunctions are not available in every region or tenantStorage has no local serviceDynamic auth claims depend on the workspace's regionRaw SQL and Observability need service-side enablementDeep linking is rolling out per tenantFunctionsFunction connections run only as the app identityLocal function connections use your own identityFive built-in audiencesConnectorsConnectors do not run under rayfin devNew Eventhouse connectors cannot be addedrayfin connector inspect does not support EventhouseInstall connector packages at the pinned versionDecorated entity classes can break a browser bundleData clientResults contain only the fields you selectcount() counts numeric values, not rowsGrouped aggregation cannot be combined with row selectionMany-to-many relationships are not supportedData API Builder (DAB)Collection queries return only one page unless you paginateTotal record counts are unsupportedBackward pagination (before) is unsupportedSelections support one relationship levelRelationshipsForeign key columns are auto-generatedForeign keys must use the {property}_id naming convention@one() / @many() only accept { optional?, unique? }AuthThe callback is onSessionChange, not onAuthStateChangeSession objects are opaqueisAuthenticated is false while the access token is expiredClient-side claims are stringsAuth config changes require a backend restartData@entity() doesn't accept composite field constraintsPrefer @anonymous() / @authenticated() over @role('anonymous' | 'authenticated', ...)Property names must be valid GraphQL field namesDatabase and schema applyRun rayfin up before rayfin up db applySchema compilation needs TypeScript 5.7.2 or laterRelative imports under rayfin/ need .js extensionsEntity names can't reuse GraphQL built-in type namesdialect is required when the Data module is enabled@text() without max breaks GraphQL schema generation on MSSQL