Edit

Quickstart: Choose a Microsoft SQL security sample

Use these Microsoft SQL security samples to compare how Data API builder (DAB) authenticates to SQL, validates users, and enforces per-user access. Each sample is self-contained, but the series moves from basic credentials to user-delegated Azure SQL access.

Choose a quickstart

Start with the question that matches your goal.

If you want to... Use this quickstart
Learn the simplest DAB-to-SQL connection pattern Username/password
Remove SQL passwords from Azure configuration Managed identity
Add Microsoft Entra token validation before requiring sign-in Microsoft Entra
Filter rows in DAB by using token claims DAB policies
Filter rows in SQL by using database-enforced row-level security SQL row-level security
Let Azure SQL authenticate the signed-in user directly On-behalf-of to Azure SQL

Decision tree

Compare the security model

The DAB authentication provider column shows the effective value for runtime.host.authentication.provider. If the configuration omits this setting, DAB uses Unauthenticated. Except for the username/password and on-behalf-of samples, local runs use SQL credentials and Azure deployments use managed identity. The on-behalf-of sample also sets data-source.user-delegated-auth.provider to EntraId.

Quickstart User to web app Web app to DAB DAB authentication provider DAB to SQL
Username/password Anonymous Anonymous Unauthenticated SQL credentials
Managed identity Anonymous Anonymous Unauthenticated Managed identity in Azure
Microsoft Entra Anonymous Anonymous EntraId Managed identity in Azure
DAB policies Microsoft Entra sign-in Bearer token EntraId Managed identity in Azure
SQL row-level security Microsoft Entra sign-in Bearer token EntraId Managed identity in Azure
On-behalf-of to Azure SQL Microsoft Entra sign-in Bearer token EntraId User-delegated token to Azure SQL