Want to be part of our priorities and roadmap? Sign up here.
Data API builder (DAB) is an open-source, no-code tool that creates secure, full-featured REST and GraphQL endpoints for your database. It’s a CRUD data API engine that runs in a container—on Azure, any other cloud, or on-premises. DAB is built for developers with integrated tooling, telemetry, and other productivity features.
Important
Data API builder (DAB) is open source and always free.
| Azure SQL | SQL Server | SQLDW | Cosmos DB | PostgreSQL | MySQL | |
|---|---|---|---|---|---|---|
| Supported | Yes | Yes | Yes | Yes | Yes | Yes |
| On-Prem | Azure | AWS | GCP | Other | |
|---|---|---|---|---|---|
| Supported | Yes | Yes | Yes | Yes | Yes |
| REST | GraphQL | MCP | |
|---|---|---|---|
| Supported | Yes | Yes | Coming soon |
Use the Getting Started tutorial to quickly explore the core tools and concepts.
1. Install the dotnet command line
Note
You may already have .NET installed!
The Data API builder (DAB) command line requires the .NET runtime version 8 or later.
dotnet --versionThe Data API builder (DAB) command line is cross-platform and intended for local developer use.
dotnet tool install microsoft.dataapibuilder -gdab --versionThis example uses a single table for simplicity.
CREATE TABLE dbo.Todo
(
Id INT PRIMARY KEY IDENTITY,
Title NVARCHAR(500) NOT NULL,
IsCompleted BIT NOT NULL DEFAULT 0
);
INSERT dbo.Todo (Title, IsCompleted)
VALUES
('Walk the dog', 0),
('Feed the fish', 0),
('Clean the cat', 1);Data API builder (DAB) supports .env files for testing process-level environment variables.
echo "my-connection-string=$env:database_connection_string" > .envecho my-connection-string=%database_connection_string% > .envecho "my-connection-string=$database_connection_string" > .envThe file .env is automatically created through this process. These are the resulting contents:
"my-connection-string=$env:database_connection_string"
Note
Be sure and replace database_connection_string with your actual database connection string.
Important
Adding .env to your .gitignore file will help ensure your secrets are not added to source control.
Data API builder (DAB) requires a JSON configuration file. Use dab --help for syntax options.
dab init
--database-type mssql
--connection-string "@env('my-connection-string')"
--host-mode developmentNote
Including --host-mode development enables Swagger for REST and Nitro for GraphQL.
The file dab-config.json is automatically created through this process. These are the resulting contents:
{
"$schema": "https://github.com/Azure/data-api-builder/releases/download/v1.5.56/dab.draft.schema.json",
"data-source": {
"database-type": "mssql",
"connection-string": "@env('my-connection-string')",
"options": {
"set-session-context": false
}
},
"runtime": {
"rest": {
"enabled": true,
"path": "/api",
"request-body-strict": true
},
"graphql": {
"enabled": true,
"path": "/graphql",
"allow-introspection": true
},
"host": {
"cors": {
"origins": [],
"allow-credentials": false
},
"authentication": {
"provider": "StaticWebApps"
},
"mode": "development"
}
},
"entities": { }
}dab add Todo
--source "dbo.Todo"
--permissions "anonymous:*"Note
DAB supports tables, views, and stored procedures. When the type is not specified, the default is table.
The entities section of the configuration is no longer empty:
{
"entities": {
"Todo": {
"source": {
"object": "dbo.Todo",
"type": "table"
},
"graphql": {
"enabled": true,
"type": {
"singular": "Todo",
"plural": "Todos"
}
},
"rest": {
"enabled": true
},
"permissions": [
{
"role": "anonymous",
"actions": [
{
"action": "*"
}
]
}
]
}
}
}In production, DAB runs in a container. In development, it’s locally self-hosted.
dab startImportant
The DAB CLI assumes your configuration file is called dab-config.json and is in the local folder.
By default, DAB enables both REST and GraphQL.
GET http://localhost:5000/api/TodoNote
Change the URL to match your port if it is different.
- DAB’s Health endpoint:
http://localhost:5000/health - DAB’s Swagger UI:
http://localhost:5000/swagger - DAB’s Nitro UI:
http://localhost:5000/graphql
DAB dynamically creates endpoints and translates requests to SQL, returning JSON.
sequenceDiagram
actor Client as Client
participant Endpoint as Endpoint
participant QueryBuilder as QueryBuilder
participant DB as Database
%% Initialization / Warming up section (light grey)
rect rgba(120,120,120,0.10)
Endpoint -->>+ Endpoint: Read Config
Endpoint ->> DB: Query Metadata
DB -->> Endpoint: Metadata Response
Endpoint ->>- Endpoint: Start Engine
end
%% Request/Response section (very light purple)
rect rgba(180,150,255,0.11)
Client ->>+ Endpoint: HTTP Request
Endpoint ->> Endpoint: Authorize
Endpoint ->> QueryBuilder: Invoke
QueryBuilder -->> Endpoint: SQL Query
Endpoint ->> DB: Submit Query
DB -->> Endpoint: Data Response
Endpoint -->>- Client: HTTP Response
end
To contribute, see these documents:
Nitro (formerly Banana Cake Pop by ChilliCream, Inc.) may optionally store work in its cloud service via your ChilliCream account. Microsoft is not affiliated with or endorsing this service. Use at your discretion.
This project may use trademarks or logos. Use of Microsoft trademarks must follow Microsoft’s Trademark & Brand Guidelines. Use of third-party marks is subject to their policies.
