Azure Data API Builder: From Database to Full-Stack App in Minutes

Azure Data API Builder: From Database to Full-Stack App in Minutes

What if you could expose your database as a REST and GraphQL API — with authentication, role-based access control, and auto-scaling — without writing a single line of backend code? That's Azure Data API Builder (DAB), and I built a comprehensive demo showing how to use it in a production-grade deployment.

What is Data API Builder?

DAB is an open-source engine from Microsoft that creates REST and GraphQL endpoints directly from your database schema. You define entities in a JSON config file, and DAB generates a full API with:

  • REST endpoints with filtering, sorting, pagination, and nested queries
  • GraphQL with full schema generation and relationship traversal
  • Entra ID authentication with role-based access control
  • Auto-generated OpenAPI spec for client SDK generation

The Demo: U.S. DOT Transportation Data

The demo application uses real-world U.S. Department of Transportation data patterns — rail accidents, bridge inspections, transit data, and vehicle safety records. It showcases how DAB handles complex, multi-table datasets with relationships.

Architecture

┌─────────────┐     ┌──────────────────┐     ┌──────────────┐
│  React SPA  │────▶│  Azure Front Door │────▶│  DAB Engine  │
│  (Nginx)    │     │  (SSL/CDN)       │     │  (REST+GQL)  │
└─────────────┘     └──────────────────┘     └──────┬───────┘
                                                     │
                                              ┌──────▼───────┐
                                              │  Azure SQL   │
                                              │  (DOT Data)  │
                                              └──────────────┘

Everything runs on Azure Container Apps with auto-scaling from 0 to 10 instances. The frontend and DAB engine are separate containers behind Azure Front Door for global load balancing and managed SSL.

DAB Configuration

The entire API is defined in a single config file. No controllers, no routes, no middleware — just data:

{
  "entities": {
    "RailAccident": {
      "source": "dot.RailAccidents",
      "permissions": [
        {
          "role": "authenticated",
          "actions": ["read"]
        },
        {
          "role": "admin",
          "actions": ["*"]
        }
      ],
      "relationships": {
        "railroad": {
          "target.entity": "Railroad",
          "cardinality": "one"
        }
      }
    }
  }
}

That config generates REST endpoints (GET /api/RailAccident, POST /api/RailAccident, etc.) and a full GraphQL schema — including relationship traversal, filtering, sorting, and pagination.

React Frontend

The React 18 + TypeScript frontend consumes the DAB-generated API with Material UI components. Features include:

  • Data grids with server-side pagination and sorting
  • Entra ID authentication with MSAL.js
  • Role-based UI — admins see CRUD controls, regular users see read-only views
  • Real-time data refresh and optimistic updates

Deployment

The repo includes multiple deployment paths:

MethodAudienceDescription
PowerShell ScriptsDevelopersFully automated end-to-end deployment
Azure Portal GuideBeginnersStep-by-step with screenshots
Cloud ShellNo Docker neededDeploy entirely from the browser
GitHub ActionsCI/CDAutomated build, push, and deploy pipeline

Why DAB Matters

DAB eliminates the most tedious part of full-stack development — writing CRUD APIs. For data-centric applications (dashboards, reporting tools, admin panels), it can replace weeks of backend development with a single config file. And because it's open-source, you can run it anywhere — not just Azure.

The full demo with documentation, deployment guides, and sample data: fgarofalo56/azure-dab-fullstack-demo

Link copied