Quickstart: Create a Fabric app in Visual Studio Code

Use the Microsoft Fabric extension for Visual Studio Code (VS Code) to create a Fabric app in your workspace and open its Getting Started page. The page provides a command tailored to your app so you can set up the local project with Rayfin, the framework for Fabric apps.

In this quickstart, you create an app named demoapp12, set up its source code locally, and run and deploy the app.

Prerequisites

Sign in and select a workspace

  1. Open VS Code. If you didn't install the Microsoft Fabric extension, open Extensions, search for Microsoft Fabric, and install the extension linked in the prerequisites.
  2. Press F1, enter Fabric: Sign in, and select the command.
  3. Complete the sign-in prompts with the account you use to access your Fabric workspace.
  4. Select Microsoft Fabric in the activity bar.
  5. In Fabric Workspaces, expand the workspace where you want to create the app. Select your workspace.

Create the app item

Create the app in your selected workspace before you set up its local project.

  1. Press F1, enter Fabric: Create item, and select the workspace.

    Screenshot of the create new item.

  2. Select App.

  3. Enter a name and press Enter to confirm.

    Screenshot of the New App name prompt after selecting the plus button beside Apps in the Fabric workspace tree.

Open the app's getting started page

You can return to the setup instructions at any time.

  1. Right-click your app item.

  2. Select Get Started.

    Screenshot of the demoapp12 app context menu with Get Started selected and Open in Fabric available below it.

The Getting Started page contains the project setup command for the selected app and workspace, along with instructions for editing the app.

Screenshot of the app Getting Started page with Copy prompt, Open a terminal, Set up your project, a dataapp template option, and Edit the app instructions.

Set up the local project

Use the command from your app's Getting Started page rather than copying the example values from the following screenshot.

  1. In VS Code, select Terminal > New Terminal.

  2. Go to the parent folder where you want to create the project.

  3. Under Set up your project on the Getting Started page, copy the full scaffold command and run it in the terminal. Follow any prompts.

    The command uses npm create @microsoft/rayfin@latest and includes settings for your selected app and workspace. Copy the complete command, including any text that extends beyond the visible code block.

  4. After setup finishes, go to the generated project folder. If you used demoapp12, run:

    cd demoapp12
    
  5. Select File > Open Folder and open the generated project folder.

  6. Review the generated files before making changes. For an explanation of the configuration and source files, see Understand the project structure.

Tip

If you want an app connected to a semantic model, the Getting Started page also provides a command that uses the dataapp template. Use that command instead of the default scaffold command, not in addition to it. See Create an app connected to a semantic model for the additional requirements and setup.

Use a coding agent instead

If you use an AI coding agent, select Copy prompt at the top of the Getting Started page and paste it into your agent's chat. For GitHub Copilot in VS Code, use Agent mode with terminal access.

Review the prompt before submitting it, approve commands as required, and complete any browser sign-in prompts. Review the generated files before deployment. You don't need to repeat the manual scaffold steps if the agent already completed them.

Run and deploy the app

Run these commands from the generated project folder, not its parent folder. The frontend runs locally, but the backend runs in Fabric.

  1. Deploy the initial app and backend to Fabric:

    npx rayfin up
    

    Complete the browser sign-in flow if prompted. Check the selected workspace before proceeding with deployment.

  2. Confirm the deployment status:

    npx rayfin up status
    

    If deployment fails, resolve the reported error before continuing. See Troubleshoot Fabric Apps.

  3. Start the frontend development server:

    npm run dev
    
  4. Open the local URL printed in the terminal to view your app. Keep the development server running while you edit and preview the frontend.

  5. Customize the app in VS Code and review your changes in the local preview.

  6. When you're ready to publish your changes, run npx rayfin up again. You can use another terminal while the development server is running.

  7. Run npx rayfin up status again and open the hosted app URL printed by the deployment command.

You created a Fabric app item, set up its local project, and deployed the app to your workspace. For more deployment options, see Deploy a Fabric app to Fabric.