Microsoft data and AI / practical developer guides

Microsoft Rayfin & Fabric Apps: Complete Developer Guide

This is the code-and-CLI companion to the Fabric Apps platform guide. Follow the generated project rather than mixing SDK examples from different versions. Prove a model change, a paginated read and a denied operation before calling the application ready.

Documentation reviewed 2026-10-30. Start small, inspect the evidence, test the permission boundary.

1. Keep this developer workflow separate from platform selection

For Fabric Apps architecture, service pricing, preview networking/ALM limitations and the decision versus other application platforms, use the Fabric Apps guide. This page focuses on the project, model/client code, deployment and verification.

Rayfin can reduce repeated backend setup, but no measured weeks-saved, near-zero infrastructure effort or performance result is claimed here. It does not automatically connect every application to an enterprise ontology, repair data quality or guarantee every downstream report is instantly current.

Keep deployment ownership, data policies and the analytical-consumption contract explicit. SQL database in Fabric integrates with OneLake; that is not a zero-delay promise or proof that a semantic model has been created and granted access.

Microsoft reference: Fabric Apps platform overview.

2. Create and inspect an isolated project

Confirm Node.js 20 or later, an allowed Fabric Apps tenant setting, assigned Fabric capacity in a supported region, and creation/deployment permissions. Use a practice item and synthetic data; do not point this exercise at the course’s existing Lakehouse tables.

npm create @microsoft/rayfin@latest uig-rayfin-demo
cd uig-rayfin-demo
npx rayfin login
npx rayfin up
npx rayfin up status
npm run dev

This follows the current first-app quickstart: deploy the backend to Fabric, then run the frontend locally. Other documented local-development flows exist. Inspect your template’s scripts and installed CLI help instead of assuming npm run dev always starts a local SQL/auth/backend stack.

Project locationRoleCheck
rayfin/dataTypeScript entity definitionsEvery field, required value and access policy matches the domain.
rayfin/data/schema.tsMaps entity names to classesRegister each new entity, not just its source file.
rayfin/rayfin.ymlService, authentication and hosting configurationConfirm the intended services and target behavior.
rayfin/.envEnvironment inputs for configurationDo not commit secrets; document variable names with an example file.
src and package.jsonTemplate-specific frontend and build scriptsInspect dev/build behavior instead of guessing.

Generated temporary artifacts are not source-of-truth model definitions. Keep credentials and temporary output out of source control. Review AI-generated files just as you would a human-authored pull request.

Microsoft reference: First-app quickstart and current status command.

3. Define a model and register its schema

Use the scaffold’s working model first. @entity(), @uuid(), @text() and other decorators define the schema; @role() declares API authorization. Current limitations require a single UUID primary-key field named id; composite keys are not supported.

A documented owner-scoped policy compares the signed-in subject to the model’s ownership field:

@role('authenticated', ['create', 'read', 'update', 'delete'], {
  policy: (claims, item) => claims.sub.eq(item.userId),
})

This is a decorator fragment for an entity that actually defines userId, not a complete standalone model. Match the scaffold’s field name, data type and identity contract. If it uses user_id, update the policy consistently rather than mixing both names.

When adding an entity, register its class in rayfin/data/schema.ts. Review required properties and defaults before creating records. A client example that supplies only a title can fail if the model also requires an owner or timestamp.

These policies are enforced on the data API path. Do not claim that a decorator automatically secures every direct SQL connection or downstream analytics surface. Review database/item permissions independently.

Microsoft reference: Model authorization policies.

4. Query the actual generated client, with pagination

Initialize the typed RayfinClient using the schema type and configuration generated for the project. The documented template variables include VITE_RAYFIN_API_URL and VITE_RAYFIN_PUBLISHABLE_KEY. A publishable key is not an admin secret; never replace it with a private credential in frontend code.

The following query fragment assumes the project already defines a typed client and a Todo entity with id and title:

const page = await client.data.Todo
  .select(['id', 'title'])
  .orderBy({ id: 'asc' })
  .first(25)
  .executePaginated();

console.log(page.items.length);
console.log(page.hasNextPage);
console.log(page.endCursor);

If more results exist, fetch the next page using after(page.endCursor) with the same selection/order. Inspect returned hasNextPage; do not fetch an unbounded dataset merely to show a list.

Two current pitfalls: count() is not available on the fluent client, and PagedResult.totalCount is not populated by the backend. page.items.length is the count of this page, not the whole table.

The current fluent API uses patterns such as select(...).execute(), findByPk(...), create({...}) and update(filter, changes). Follow the SDK version’s documentation instead of combining those with a different library’s findMany({data: ...}) shape. Surface request errors to the user; an empty-state UI must not disguise an authentication or schema failure.

Microsoft reference: Typed GraphQL client and pagination.

5. Test ownership and persistence before deployment

  1. Sign in using the authentication mode appropriate to the environment. Deployed signed-in apps use Fabric Entra SSO; local email/password is not a production identity provider.
  2. Using approved test identity A, create a synthetic record with every required property and correct owner value. Read it and verify persistence after a frontend reload.
  3. As test identity B, attempt to read/update A’s record directly through the generated API. A hidden frontend button is not a denied-access test.
  4. Try to create a record with another identity’s owner value. The server-side policy must not permit impersonating ownership.
  5. Verify excluded fields and omitted actions are denied. Test a valid update separately, then remove only the known demo record.

Anonymous static assets and anonymous data operations are different settings. The latter requires tenant approval and explicit app/entity configuration. Keep anonymous data off for this owner-scoped exercise; anonymous requests do not have a subject claim to establish ownership.

Acceptance evidence should identify the environment, actor, operation and allowed/denied result without recording tokens or sensitive payloads. These are instructions for a practice run, not tenant execution claimed by this article.

Microsoft reference: Model authorization policies.

6. Deploy a reviewed schema change and plan recovery

Commit a baseline and review the model diff. Build with the project’s documented script, then deploy to the intended demo workspace. Check the installed CLI help before using flags from an old tutorial.

npm run build
npx rayfin up
npx rayfin up status

# Apply a reviewed database schema change where appropriate:
npx rayfin up db apply

The status command is rayfin up status, not the obsolete top-level rayfin status example. For an explicit deployment target, the first-app guide documents npx rayfin up --workspace <workspacename>. Confirm the actual target/output before accepting a write.

After deployment, verify the app item, backend URL, child services, saved schema and one permitted/denied request. The app database portal is a read/query surface: manage schema from code to avoid conflicts with deployment.

A redeployed older commit is an application rollback, not recovery of a dropped column or deleted record. Review destructive schema changes, preserve required data and establish its recovery path before applying them. Do not promise that re-running the CLI is the only fix for every database conflict.

Current Fabric Apps documentation does not provide built-in ALM or automatic multi-environment management. Separate workspaces/items can be managed manually. Do not describe a CLI switch as a complete CI/CD or production recovery strategy.

Microsoft reference: Rayfin CLI reference.

7. Licensing, costs and when to stop

Assigned Fabric capacity and tenant/item access are required. The earlier F4-development/F32-production recommendations and F64/Pro licensing rule were not established by the Fabric Apps documentation, so they are not sizing or licensing requirements in this guide. Confirm your app’s current terms and benchmark its actual workload.

Database compute/storage, GraphQL processing, used User Data Functions and OneLake asset operations contribute to cost. Authentication and the app routing/hosting service currently have no separate CU charge; not every request burns a separate background authentication meter. See the platform guide and current pricing page for the service boundaries.

Current limitations include no custom identity providers, no composite keys/direct many-to-many relationship support, and no Fabric Apps private-link/outbound-protection support. Choose an application platform from actual requirements rather than broad claims that every alternative creates an ungoverned silo.

Use the practice result to decide the next step: fix a failing authorization or schema check before adding features. After practice, stop the local frontend and review demo-item data/dependencies before removing only those approved resources. Do not delete shared capacity or analytical tables as cleanup.

Microsoft reference: Service costs.

Common questions

What is Rayfin's role in Fabric Apps?

Rayfin is the developer SDK and CLI. Fabric Apps is the managed backend platform. This guide focuses on project/model/client/deployment work; the Fabric Apps companion covers platform architecture, service costs and preview constraints.

Why must I register an entity in schema.ts?

The project schema map connects entity names to their TypeScript classes for typed client access. Creating a model file alone is not the complete registration step. Follow the scaffold's actual schema structure.

Can I use totalCount or count() to count all records?

Not currently on the documented fluent client. count() is unavailable and PagedResult.totalCount is not populated. items.length counts the current page; use pagination and a supported counting design for a real whole-dataset requirement.

What is the current deployment status command?

Use npx rayfin up status. The current first-app quickstart deploys the backend to Fabric and then runs the frontend locally; inspect template scripts before assuming npm run dev starts an entire local backend.

Does deploying an old commit recover deleted data?

No. Redeploying code and recovering source data are separate operations. Review schema diffs, preserve required data and test a data recovery plan before applying destructive changes.

Official references and review scope

Checked against the following official vendor documentation on 2026-10-30. This is an independent learning guide, not a Microsoft certification, benchmark or customer deployment report. These workflows have not been executed in your tenant. Expected values are teaching acceptance checks; validate feature availability, identity, network, schema, data handling and recovery requirements before production use.

Scroll to Top