Blog Post

Fabric Updates Blog
3 MIN READ

Fabric App functions to use secure server-side custom logic (Preview)

mk_sunitha's avatar
mk_sunitha
Icon for Microsoft Employee rankMicrosoft Employee
6 days ago

Fabric App functions is a new capability that allows builders to add secure, server-side logic directly to their Fabric Apps without standing up separate infrastructure. Built on top of Fabric User Data Functions (UDFs), Fabric App functions give developers a simple way to execute business logic, integrate with external services, access protected resources, and keep secrets from the client.

Figure: Get started with functions in your Fabric app.

What are Fabric App functions?

Fabric App functions are TypeScript-based serverless functions that run alongside your Fabric app. They provide a secure backend execution environment for code that should not run in the browser. Functions are packaged and deployed as part of the application experience and can be invoked directly from the application through a typed client.

Think of Functions as the custom logic layer for your Fabric App:

  • Execute business rules and complex calculations
  • Access protected data sources
  • Call external APIs
  • Perform orchestration and AI workflows
  • Store and retrieve secrets securely
  • Access downstream resources using the application’s identity via application authentication

Application authentication

Application authentication means the Fabric app function accesses a downstream resource using the application’s identity rather than impersonating the person currently using the app. The downstream service sees and authorizes the application, not the signed-in user.

How the identity flow works

The user signs in to the Fabric App, the app calls the function, and the function then calls the downstream service using the application identity.

  • Grant the application only the permissions it needs.
  • Authorize the application at the downstream service.
  • Keep credentials and tokens out of client-side code.
  • Add application-level validation and business logic before accessing data.

Secrets management

Functions allow builders to securely store and retrieve secrets without exposing them to browsers or application users.

Figure: Add and manage secrets for Fabric app functions.

Get started with functions

Fabric App functions are designed to feel like part of the application, not a separate platform. Key dependency is to install Azure Functions Core Tools version 4 before you get started.

npm install --global azure-functions-core-tools@4

Create an app with functions

Scaffold a new app, move to the app directory, and initialize its functions project:

npm create @microsoft/rayfin@latest -- "my-app"
cd my-app
npx rayfin functions init

The Fabric App functions init command adds the functions project, TypeScript configuration, and a starter function file to the existing app.

Build the app with GitHub Copilot

The scaffold includes the GitHub Copilot instructions and skills needed to work with the project. Open the project in Visual Studio Code, then describe the app you want to build in GitHub Copilot Chat.

For example, use this prompt to build an AI pull request review assistant:

Build an app that lets me view all pull requests for the repository <repoURL>, chat with my Azure AI Foundry agent <agentName> to review pull requests, and post review comments. Use functions with application authentication to connect to Azure AI Foundry and Azure DevOps.

GitHub Copilot can generate and update the required files and components. You can also ask the agent to run the app, debug functions locally, and deploy the app.

Debug functions

You can run functions locally to test your server-side logic before deploying to Fabric. Use the local Azure functions host to invoke functions, inspect errors, and validate your integration. Once validated, deploy the app and functions together. Run the following command to test your functions and deploy your changes.

npx rayfin dev
npx rayfin up

Conclusion

If you’ve been waiting for a secure way to connect Fabric Apps to external services, protect secrets, use application authentication, or build AI-powered experiences, Fabric App functions are the missing piece.

To learn more, refer to the Fabric Apps documentation.

Updated 12 days ago
Version 1.0
No CommentsBe the first to comment