Exercise - Scaffold a first Fabric app
In this exercise, you scaffold the Adventure Works Cycles sales dashboard as a Fabric app. You first confirm that your tenant and workspace are ready, then you create the project and find its key files. You keep the project for the next exercises.
Check your environment
Before you create the project, confirm each requirement. These checks prevent most first-run failures.
- Tenant setting: A Fabric administrator enabled the Fabric Apps tenant setting for you. If you can't create Fabric Apps items, ask an administrator.
- Workspace: Open a workspace where you have the Contributor, Member, or Admin role. Confirm that the workspace is assigned to a Fabric trial or paid capacity. If you don't have a capacity, see Fabric trial capacity.
- Region: Confirm that the capacity region supports Fabric Apps. Check Fabric region availability, because Fabric Apps isn't available in every region yet.
- Node.js: In a terminal, run
node --version. The output starts withv24if you use the recommended version. The CLI supports Node.js 20, 22, and 24, and the default project template needs 22.13 or later.
Scaffold the project
In a terminal, go to the folder where you keep projects.
Run the scaffold command. Replace
<workspace-name>with the name of your workspace.npm create @microsoft/rayfin@latest -- adventure-dashboard --workspace <workspace-name>At How would you like to start?, select Use default template and press Enter. This creates a Universal App. Answer any prompts that remain.
Go to the new folder, install dependencies, and open the folder in your editor.
cd adventure-dashboard npm installThis installs the project's dependencies, including the Rayfin CLI and SDK packages used by the template. You don't need to install the CLI globally.
You should see scaffold output similar to the following example. Your folder path, workspace name, and Node.js version might differ. The Project created successfully! message confirms that scaffolding completed.
~/git/fabric-apps node --version v24.22.3 ~/git/fabric-apps npm create @microsoft/rayfin@latest -- adventure-dashboard --workspace fabric-apps-workspace > npx > 'create-rayfin' adventure-dashboard --workspace fabric-apps-workspace ? How would you like to start? ✨ Use default template ____ __ _ | _ \ __ _ _ _ / _(_)_ __ | |_) / _` | | | | |_| | '_ \ | _ < (_| | |_| | _| | | | | |_| \_\__,_|\__, |_| |_|_| |_| |___/ Let's create your project. 🔖 Project name: adventure-dashboard 🚀 Creating project "adventure-dashboard" (adventure-dashboard) from "✨ Use default template" template ✔ ✅ Template files copied ✔ ✅ Template customized ✔ ✅ Dependencies installed ✔ ✅ Scaffolding files synchronized 🎉 Project created successfully! Next steps: cd adventure-dashboard npx rayfin dev 📌 Persisted Fabric environment overrides into rayfin/.env
Identify the key files
- Open
rayfin/rayfin.yml. Findservices.staticHostingand note itspathvalue. It points to the frontend package. - In the same file, find
services.data. The value ofenabledisfalsebecause data is opt-in in a Universal App. - Expand
packages/. Find thefrontend,data, andsharedfolders. - Open the
package.jsonin the project root. Find thedevscript and confirm that it runsrayfin dev.
Your rayfin/rayfin.yml file should look similar to this example:
id: adventure-dashboard
name: adventure-dashboard
version: 1.0.0
services:
auth:
enabled: true
fabric:
enabled: true
externalEntraExchange: true
password:
enabled: false
allowedRedirectUris:
- http://localhost:5173
data:
enabled: false # Data is opt-in; this template starts with it disabled.
path: packages/data
buildCommand: npm run build
staticHosting:
enabled: true
path: packages/frontend # Frontend package used for static hosting.
folder: dist
buildCommand: npm run build:fabric
indexDocument: index.html
assetAccess: protected
embedded:
only: false