Tag: Data API Builder

Configure and implement DAB deployment (DP-800 Exam Prep)

This post is a part of the DP-800: Developing AI-Enabled Database Solutions Exam Prep Hub.
This topic falls under these sections:
Secure, optimize, and deploy database solutions (35–40%)
   --> Integrate SQL solutions with Azure services
      --> Configure and implement DAB deployment


Note that there are 10 practice questions (with answers) at the end of each section to help you solidify your knowledge of the material. Also, there are 4 practice tests with 30 questions each available from the hub's main page below the exam topics section.

Introduction

Modern applications frequently require secure, scalable APIs to expose database objects without developers having to build and maintain extensive backend code. Data API Builder (DAB) is a Microsoft open-source runtime that automatically exposes Azure SQL Database, SQL Server, Azure Cosmos DB, PostgreSQL, and MySQL databases through REST and GraphQL endpoints.

While creating DAB configuration files is important, equally critical is deploying DAB securely and reliably into development, testing, staging, and production environments. The DP-800 exam expects SQL AI Developers to understand how DAB fits into CI/CD pipelines, containerized environments, Azure App Service, Azure Container Apps, Kubernetes, authentication systems, and infrastructure automation.

Understanding deployment strategies helps ensure that APIs remain secure, available, scalable, and maintainable.


What Is Data API Builder Deployment?

Deployment refers to the process of publishing the DAB runtime together with its configuration so that applications can consume database APIs.

A deployment includes:

  • Installing the DAB runtime
  • Providing the configuration file
  • Supplying environment variables
  • Configuring authentication
  • Connecting to databases
  • Deploying to the chosen hosting platform
  • Configuring monitoring
  • Configuring scaling
  • Managing updates

Unlike traditional applications, DAB is largely configuration-driven. Most deployments involve changing configuration rather than application code.


Common Deployment Targets

Microsoft supports several deployment options.

Local Development

Developers often begin locally using:

  • Windows
  • Linux
  • macOS

Example:

dab start

Advantages include:

  • Fast testing
  • Easy debugging
  • Local SQL Server integration
  • Rapid API validation

Local deployments should never expose production credentials.


Azure App Service

Azure App Service is one of the simplest production deployment options.

Benefits include:

  • Fully managed hosting
  • HTTPS enabled
  • Automatic scaling
  • Managed Identity
  • Deployment slots
  • Azure Monitor integration

Typical architecture:

Client
|
Azure App Service
|
Data API Builder
|
Azure SQL Database

Azure Container Apps

Many organizations package DAB inside a Docker container.

Advantages include:

  • Container portability
  • Autoscaling
  • Microservices architecture
  • Revision management
  • Simple CI/CD integration

Container Apps are becoming increasingly common for cloud-native solutions.


Azure Kubernetes Service (AKS)

Larger organizations often deploy DAB using Kubernetes.

Benefits include:

  • High availability
  • Rolling updates
  • Horizontal scaling
  • Container orchestration
  • Service mesh integration

Although AKS offers the most flexibility, it is also the most complex deployment option.


Docker

DAB is commonly deployed as a Docker container.

Example Dockerfile:

FROM mcr.microsoft.com/data-api-builder
COPY dab-config.json /App/

Benefits include:

  • Consistent environments
  • Easy version control
  • Portable deployments
  • Works across cloud providers

DAB Configuration During Deployment

Every deployment needs access to:

  • dab-config.json
  • Database connection information
  • Authentication settings
  • Runtime configuration

The configuration file should be packaged together with the deployment or mounted as a configuration volume.


Environment Variables

Production deployments should avoid hardcoded settings.

Instead, use environment variables.

Examples:

SQL_CONNECTION_STRING
AZURE_CLIENT_ID
AZURE_TENANT_ID
JWT_AUDIENCE

Benefits include:

  • Improved security
  • Easier environment changes
  • Better DevOps automation

Secure Connection Strings

Never store credentials directly inside configuration files.

Instead use:

  • Azure Key Vault
  • GitHub Secrets
  • Azure DevOps Library
  • Kubernetes Secrets
  • Environment variables

Example:

Instead of:

Password=MyPassword123

Use:

Password=${SQL_PASSWORD}

Managed Identity

One of Microsoft’s recommended deployment practices is using Managed Identity.

Instead of storing SQL credentials:

Application
|
Managed Identity
|
Azure SQL

Benefits include:

  • No stored passwords
  • Automatic credential rotation
  • Azure AD authentication
  • Reduced attack surface

DP-800 heavily emphasizes Managed Identity.


Authentication Configuration

Production deployments usually configure authentication providers such as:

  • Microsoft Entra ID
  • JWT providers
  • OAuth 2.0
  • Static development authentication (development only)

Authentication should be enabled before exposing APIs publicly.


HTTPS

Production DAB deployments should always use HTTPS.

Benefits include:

  • Encrypts traffic
  • Protects authentication tokens
  • Prevents packet interception
  • Supports secure REST and GraphQL endpoints

Azure App Service enables HTTPS automatically.


Reverse Proxies

Many production deployments place DAB behind:

  • Azure API Management
  • Azure Front Door
  • Azure Application Gateway
  • NGINX
  • Traefik

Advantages:

  • Centralized security
  • Rate limiting
  • Caching
  • Authentication
  • Request logging

CI/CD Deployment

DAB deployments fit naturally into DevOps pipelines.

Typical pipeline:

Developer
|
Git Repository
|
Build Pipeline
|
Unit Tests
|
Create Docker Image
|
Deploy
|
Smoke Tests
|
Production

Azure DevOps Deployment

Typical stages include:

  • Restore dependencies
  • Build
  • Validate DAB configuration
  • Build container
  • Push image
  • Deploy
  • Run validation tests

GitHub Actions

GitHub Actions commonly automate DAB deployment.

Example workflow:

Push
Build
Run Tests
Create Container
Publish Image
Deploy Azure

Infrastructure as Code

Many organizations deploy DAB using:

  • Bicep
  • ARM templates
  • Terraform

Benefits include:

  • Repeatability
  • Version control
  • Consistent infrastructure
  • Automated provisioning

Configuration Validation

Before deployment, validate:

  • JSON syntax
  • Entity definitions
  • Authentication settings
  • Database connectivity
  • GraphQL relationships
  • Stored procedure mappings

Validation reduces deployment failures.


Monitoring

Production deployments should include monitoring.

Useful Azure services include:

  • Azure Monitor
  • Application Insights
  • Log Analytics
  • Azure Diagnostics

Monitor:

  • Request latency
  • Errors
  • Authentication failures
  • API throughput
  • CPU
  • Memory

Logging

Logs assist troubleshooting.

Typical events:

  • Startup failures
  • Invalid requests
  • Authentication failures
  • Database connection errors
  • SQL execution errors

Logs should never expose sensitive information.


Scaling DAB

Scaling depends on the hosting platform.

Azure App Service

  • Scale up
  • Scale out

Azure Container Apps

  • Autoscaling
  • Revision-based deployments

AKS

  • Horizontal Pod Autoscaler
  • Multiple replicas

High Availability

Production deployments commonly use:

  • Multiple DAB instances
  • Load balancers
  • Regional redundancy
  • Health probes

These reduce downtime.


Deployment Slots

Azure App Service supports deployment slots.

Example:

Production
Staging Slot
Validation
Swap

Benefits:

  • Zero-downtime deployment
  • Easy rollback
  • Safe production updates

Versioning

Multiple API versions may run simultaneously.

Example:

v1
v2
v3

Benefits include:

  • Backward compatibility
  • Easier client migration
  • Controlled feature rollout

Rollback Strategy

Every deployment should support rollback.

Common methods:

  • Previous Docker image
  • Previous deployment slot
  • Previous Git tag
  • Previous release pipeline

Rollback minimizes production risk.


Security Best Practices

Recommended practices include:

  • HTTPS only
  • Managed Identity
  • Least privilege
  • Azure Key Vault
  • Authentication enabled
  • Authorization configured
  • Secure secrets
  • Monitor logs
  • Enable auditing
  • Disable unused endpoints

DP-800 Exam Tips

Remember these key points:

  • DAB deployments commonly use Azure App Service, Azure Container Apps, Docker, or AKS.
  • Avoid hardcoded secrets.
  • Prefer Managed Identity over SQL usernames/passwords.
  • Store secrets in Azure Key Vault.
  • Automate deployments using GitHub Actions or Azure DevOps.
  • Validate configurations before deployment.
  • Use deployment slots to minimize downtime.
  • Monitor deployments with Azure Monitor and Application Insights.
  • Use HTTPS for every production deployment.
  • Implement rollback strategies.

Practice Exam Questions

Question 1

Your organization wants to deploy Data API Builder with automatic operating system patching, built-in HTTPS, deployment slots, and minimal administrative overhead.

Which deployment target best meets these requirements?

A. Azure Kubernetes Service

B. Azure App Service

C. Self-managed virtual machine

D. Docker Desktop

Answer: B

Explanation: Azure App Service is a fully managed platform that provides HTTPS, automatic OS maintenance, deployment slots, autoscaling, and simplified application hosting.


Question 2

A company wants to eliminate database passwords from its DAB deployment while securely authenticating to Azure SQL Database.

What is the recommended authentication method?

A. Store SQL credentials in Git

B. Use SQL Authentication with encrypted passwords

C. Use Azure Managed Identity

D. Create a shared administrator account

Answer: C

Explanation: Managed Identity removes the need to store credentials, uses Microsoft Entra ID authentication, and automatically manages credential rotation.


Question 3

Which deployment practice provides the greatest protection for database connection strings?

A. Embed the connection string in the DAB configuration file

B. Store the connection string in application source code

C. Save credentials in a shared documentation file

D. Store secrets in Azure Key Vault and reference them during deployment

Answer: D

Explanation: Azure Key Vault securely stores secrets outside application code and integrates with Managed Identity and deployment pipelines.


Question 4

During deployment, a development team wants every code commit to automatically build, validate, test, and deploy DAB.

Which approach should they use?

A. Manual deployment using PowerShell

B. SQL Server Management Studio

C. A CI/CD pipeline using GitHub Actions or Azure DevOps

D. Windows Task Scheduler

Answer: C

Explanation: CI/CD pipelines automate builds, testing, validation, packaging, and deployment, reducing manual effort and deployment errors.


Question 5

Why should production DAB deployments use HTTPS?

A. It increases SQL query speed.

B. It compresses GraphQL responses.

C. It encrypts network communication between clients and the API.

D. It eliminates authentication requirements.

Answer: C

Explanation: HTTPS protects sensitive information such as authentication tokens and API traffic from interception during transmission.


Question 6

Which Azure service is specifically designed to collect application telemetry, performance metrics, and diagnostics for deployed DAB applications?

A. Azure Application Insights

B. Azure Storage Explorer

C. Azure Bastion

D. Azure Data Factory

Answer: A

Explanation: Application Insights provides monitoring, distributed tracing, diagnostics, performance metrics, and failure analysis for deployed applications.


Question 7

A team wants to release a new DAB version without interrupting production users and retain the ability to roll back immediately if problems occur.

Which Azure App Service feature should they use?

A. Reserved instances

B. Deployment slots

C. Availability zones

D. Geo-replication

Answer: B

Explanation: Deployment slots allow applications to be validated before swapping into production and enable quick rollback if issues are discovered.


Question 8

Why are environment variables commonly used during DAB deployment?

A. They automatically optimize SQL queries.

B. They eliminate authentication requirements.

C. They reduce GraphQL response sizes.

D. They separate configuration from application code and simplify deployment across environments.

Answer: D

Explanation: Environment variables allow different settings for development, testing, and production without modifying the application or configuration files.


Question 9

Which deployment platform provides the highest level of container orchestration and scalability for large enterprise DAB deployments?

A. Azure Kubernetes Service

B. Azure App Service

C. Windows Server

D. Docker Desktop

Answer: A

Explanation: AKS offers advanced orchestration, automatic scaling, rolling updates, service discovery, and high availability for enterprise containerized workloads.


Question 10

Before promoting a DAB deployment to production, what validation activity is most important?

A. Disable authentication temporarily.

B. Increase CPU resources.

C. Validate configuration files, authentication settings, and database connectivity.

D. Remove monitoring to improve performance.

Answer: C

Explanation: Validating configuration, connectivity, and authentication helps prevent deployment failures and ensures the API functions correctly before reaching production users.


Go to the DP-800 Exam Prep Hub main page

Create configuration files for Data API builder (DAB) – Part 2 (DP-800 Exam Prep)

This post is a part of the DP-800: Developing AI-Enabled Database Solutions Exam Prep Hub.
This topic falls under these sections:
Secure, optimize, and deploy database solutions (35–40%)
   --> Integrate SQL solutions with Azure services
      --> Create configuration files for Data API builder (DAB)


Note that there are 10 practice questions (with answers) at the end of each section to help you solidify your knowledge of the material. Also, there are 4 practice tests with 30 questions each available from the hub's main page below the exam topics section.

Advanced Entity Configuration

While a basic DAB configuration can expose an entire table with only a few lines of JSON, enterprise applications typically require much more granular control. Developers can customize how entities are exposed, which operations are permitted, and who can access specific data.

Advanced entity configuration allows you to:

  • Rename API endpoints
  • Restrict CRUD operations
  • Configure role-based permissions
  • Expose only selected database objects
  • Map views and stored procedures
  • Customize GraphQL object names
  • Define relationships between entities

This flexibility allows developers to build secure APIs without writing application code.


Configuring Entity Permissions

One of the most important sections of a DAB configuration file is the permissions section.

Example:

"permissions": [
{
"role": "anonymous",
"actions": [ "read" ]
}
]

Permissions determine which operations a role may perform.

Supported actions include:

  • Read
  • Create
  • Update
  • Delete
  • Execute (stored procedures)

For DP-800, understand that permissions are configured at the entity level rather than the database level.


Role-Based Authorization

DAB uses roles to authorize requests after a user has been authenticated.

Example roles might include:

  • anonymous
  • authenticated
  • reader
  • contributor
  • manager
  • administrator

Example:

"permissions": [
{
"role": "reader",
"actions": [ "read" ]
},
{
"role": "administrator",
"actions": [ "create","read","update","delete" ]
}
]

In this example:

Readers can only retrieve data.

Administrators can perform all CRUD operations.


Field-Level Permissions

Some applications should expose only specific columns.

For example:

Employee table

  • EmployeeID
  • Name
  • Department
  • Salary
  • SocialSecurityNumber

Instead of exposing every column, DAB can restrict access through permissions and by configuring the entity to expose only approved fields (combined with database permissions where appropriate).

Although SQL permissions remain the primary security boundary, DAB provides another layer of API security.


Using Views Instead of Tables

Many organizations expose SQL views instead of tables.

Advantages include:

  • Hide sensitive columns
  • Simplify queries
  • Enforce business rules
  • Reduce accidental data exposure

Example

"source": {
"object": "dbo.vwCustomerSummary",
"type": "view"
}

Views are often considered a security best practice.


Exposing Stored Procedures

DAB supports stored procedures as API endpoints.

Example

"source": {
"object": "dbo.GetSalesSummary",
"type": "stored-procedure"
}

REST example

POST /api/GetSalesSummary

GraphQL example

mutation

Stored procedures are especially useful when:

  • Complex business logic exists
  • Multiple tables must be updated
  • Validation is required
  • Reporting queries are expensive

Authentication Providers

Authentication determines who a user is.

Authorization determines what that user may do.

Data API builder supports multiple authentication providers.

Common providers include:

  • Anonymous
  • Microsoft Entra ID
  • Azure Static Web Apps Authentication
  • JSON Web Tokens (JWT)
  • OAuth providers

The authentication provider is configured in the runtime section.


Microsoft Entra ID Authentication

Microsoft recommends Microsoft Entra ID for production environments.

Benefits include:

  • Enterprise identity management
  • Single Sign-On (SSO)
  • Multi-factor authentication
  • Conditional Access
  • Managed identities
  • Centralized security

Using Entra ID reduces the need to manage usernames and passwords within applications.


Azure Static Web Apps Authentication

When DAB is deployed alongside Azure Static Web Apps, authentication can be handled automatically.

Supported providers include:

  • Microsoft
  • GitHub
  • Google
  • X (formerly Twitter) (where supported)
  • Custom OpenID Connect providers

The application receives authenticated user information without requiring developers to implement custom login functionality.


JSON Web Tokens (JWT)

JWT authentication is commonly used in REST APIs.

Workflow:

  1. User authenticates.
  2. Identity provider issues a JWT.
  3. Client sends the JWT with each request.
  4. DAB validates the token.
  5. Permissions are applied.

JWT authentication enables stateless API security.


Managed Identity

Managed Identity is one of Microsoft’s preferred authentication methods for Azure resources.

Instead of storing credentials:

Username
Password

Azure automatically manages an identity for the application.

The application authenticates using Azure Active Directory (Microsoft Entra ID).

Benefits include:

  • No passwords
  • Automatic credential rotation
  • Improved security
  • Easier administration
  • Reduced risk of credential leakage

This is a frequently tested DP-800 topic.


Connecting DAB to Azure SQL with Managed Identity

Typical flow:

Azure App Service
Managed Identity
Microsoft Entra ID
Azure SQL Database

No SQL username or password needs to be stored in the configuration file.


Connection Strings with Managed Identity

Instead of:

Server=...
User ID=admin
Password=...

Developers use an authentication method supported by Azure SQL that relies on Managed Identity (for example, Authentication=Active Directory Managed Identity in the connection string, depending on the client and environment).

Benefits include:

  • No secrets
  • Easier rotation
  • Improved compliance
  • Better security posture

Cross-Origin Resource Sharing (CORS)

Modern web applications often call APIs hosted on different domains.

Example:

Website

https://contoso.com

API

https://api.contoso.com

Without CORS configuration:

Browser blocks the request.

DAB allows developers to configure permitted origins.

Example

Allowed Origins
https://contoso.com

This prevents unauthorized websites from making browser-based requests to the API.


Azure App Service Deployment

DAB is frequently deployed to Azure App Service.

Deployment steps typically include:

  1. Publish DAB.
  2. Upload configuration file.
  3. Configure environment variables.
  4. Configure Managed Identity.
  5. Grant Azure SQL permissions.
  6. Enable HTTPS.
  7. Test REST endpoints.
  8. Test GraphQL endpoints.

Azure Container Apps

Container Apps provide a lightweight alternative to Kubernetes.

Benefits include:

  • Autoscaling
  • Container support
  • Easy deployment
  • Native Azure integration
  • Lower operational overhead than managing a Kubernetes cluster

DAB runs well inside containers.


Azure Kubernetes Service (AKS)

Large organizations often deploy DAB using Kubernetes.

Benefits include:

  • High availability
  • Rolling updates
  • Autoscaling
  • Container orchestration
  • Enterprise management

The configuration file remains largely the same regardless of the hosting platform.


Azure Static Web Apps Integration

One common architecture is:

Static Web App
Data API Builder
Azure SQL Database

Advantages include:

  • Secure authentication
  • Built-in authorization integration
  • REST support
  • GraphQL support
  • Low operational cost
  • Automatic HTTPS

Environment Variables

Instead of storing values inside the configuration file:

Connection String
JWT Secret
API Keys
URLs

Developers store them as environment variables.

Benefits include:

  • Easier deployments
  • Better security
  • CI/CD friendly
  • No secrets in Git
  • Different values for Dev/Test/Production

Azure Key Vault

Environment variables may reference secrets stored in Azure Key Vault.

Typical secrets include:

  • Database passwords
  • Certificates
  • API keys
  • OAuth secrets
  • Encryption keys

Benefits include:

  • Centralized secret management
  • Access auditing
  • Automatic secret rotation
  • Fine-grained access control
  • Compliance support

Logging

Production deployments should enable logging.

Common information includes:

  • Authentication failures
  • API requests
  • SQL errors
  • Performance metrics
  • Authorization failures

Logs can be integrated with:

  • Azure Monitor
  • Application Insights
  • Log Analytics

These tools help diagnose operational issues and monitor API health.


Common Configuration Mistakes

Many deployment failures result from configuration errors rather than application bugs.

Common mistakes include:

  • Invalid JSON syntax
  • Missing commas or braces
  • Incorrect object names
  • Typographical errors in table names
  • Invalid connection strings
  • Missing environment variables
  • Authentication configuration errors
  • Missing permissions
  • Disabled REST endpoints
  • Disabled GraphQL endpoints

Always validate configuration before deployment.


Troubleshooting REST Endpoints

If an endpoint does not respond correctly, verify:

  • Is REST enabled?
  • Does the entity exist?
  • Does the SQL object exist?
  • Is authentication configured correctly?
  • Are permissions assigned?
  • Is the endpoint path correct?
  • Is the API reachable over HTTPS?

These are common troubleshooting steps in real-world deployments.


Troubleshooting GraphQL

If GraphQL queries fail:

  • Verify GraphQL is enabled.
  • Check entity names.
  • Confirm relationships are configured correctly.
  • Validate user permissions.
  • Review authentication settings.
  • Inspect logs for schema generation or query errors.

GraphQL errors are often related to configuration rather than SQL syntax.


DAB Best Practices

Microsoft recommends the following practices:

  • Use Microsoft Entra ID whenever possible.
  • Prefer Managed Identity over passwords.
  • Store secrets in Azure Key Vault.
  • Keep configuration files in source control.
  • Exclude secrets from Git repositories.
  • Use separate environments for development, testing, and production.
  • Follow the principle of least privilege.
  • Expose only the database objects required by the application.
  • Prefer views when exposing sensitive data.
  • Monitor API activity using Azure Monitor and Application Insights.
  • Regularly review permissions and authentication settings.
  • Test configuration changes in a non-production environment before deployment.

Real-World Example

A retail company wants to expose product information to a web application.

Requirements:

  • Customers can view products.
  • Employees can update inventory.
  • Administrators can manage all data.
  • No passwords should be stored in source control.
  • APIs should support both REST and GraphQL.
  • Azure SQL Database is used as the backend.

A recommended DAB solution would include:

  • Azure SQL Database as the data source.
  • Microsoft Entra ID for authentication.
  • Managed Identity for connecting to Azure SQL.
  • Entity permissions granting read access to customers, update access to employees, and full CRUD access to administrators.
  • REST and GraphQL endpoints enabled.
  • Environment variables and Azure Key Vault for configuration and secrets.
  • Deployment to Azure App Service or Azure Container Apps with HTTPS enabled.

DP-800 Exam Tips

When preparing for the DP-800 exam, be sure you can:

  • Explain the purpose of each major section in a DAB configuration file.
  • Configure data sources for Azure SQL Database.
  • Understand how entities map to tables, views, and stored procedures.
  • Configure REST and GraphQL endpoints.
  • Implement role-based permissions.
  • Distinguish authentication from authorization.
  • Explain the benefits of Microsoft Entra ID and Managed Identity.
  • Describe how environment variables and Azure Key Vault improve security.
  • Recognize appropriate Azure hosting options for DAB.
  • Identify common configuration and deployment errors.
  • Apply security best practices when exposing database objects through APIs.

Practice Exam Questions


Question 1

Your organization wants to expose data from an Azure SQL Database through Data API builder. You want to specify the database connection information in the DAB configuration file.

Which section of the configuration file should you modify?

A. runtime

B. entities

C. data-source

D. authentication

Correct Answer: C

Explanation

The data-source section defines the backend database used by Data API builder. It contains information such as the database type, connection string, and provider.

  • The runtime section controls API behavior.
  • The entities section defines which database objects are exposed.
  • Authentication settings belong under the runtime configuration.

Question 2

A development team wants to avoid storing database passwords in the DAB configuration file stored in GitHub.

What is the recommended approach?

A. Encrypt the password using Base64.

B. Store the connection string in an environment variable or Azure Key Vault.

C. Place the password in a separate JSON file.

D. Store the password inside the runtime section.

Correct Answer: B

Explanation

Microsoft recommends storing sensitive information such as connection strings and secrets outside the configuration file by using environment variables or Azure Key Vault. This improves security and supports multiple deployment environments.

Base64 encoding is not encryption and does not protect credentials.


Question 3

A developer creates an entity that maps to the Products table.

What is the primary purpose of the entity definition?

A. Configure Azure authentication.

B. Define database backup policies.

C. Specify which database object is exposed through REST and GraphQL endpoints.

D. Enable SQL auditing.

Correct Answer: C

Explanation

Entities map database objects—such as tables, views, or stored procedures—to automatically generated REST and GraphQL endpoints.

Authentication, auditing, and backup configuration are handled elsewhere.


Question 4

A company wants every database API to support both REST and GraphQL.

Which runtime configuration should be enabled?

A. Enable REST and GraphQL in the runtime section.

B. Configure only the data-source section.

C. Configure only entity permissions.

D. Enable Azure Monitor.

Correct Answer: A

Explanation

The runtime section controls whether REST and GraphQL endpoints are available. Enabling both services allows clients to access the exposed entities through either API style.

Azure Monitor provides monitoring but does not enable APIs.


Question 5

A developer wants to expose a SQL view instead of a table.

Why is this commonly recommended?

A. Views automatically improve SQL Server performance.

B. Views prevent SQL injection attacks.

C. Views can simplify data exposure and hide sensitive columns.

D. Views eliminate the need for permissions.

Correct Answer: C

Explanation

Views allow organizations to expose only the required columns and business logic while hiding sensitive information. They also simplify complex joins and provide an additional abstraction layer.

Views do not automatically improve performance or eliminate security requirements.


Question 6

Your Data API builder application is deployed to Azure App Service.

How should the application authenticate to Azure SQL Database without storing credentials?

A. SQL Authentication

B. Windows Authentication

C. Shared Access Signature (SAS)

D. Managed Identity

Correct Answer: D

Explanation

Managed Identity allows Azure resources to authenticate securely without storing usernames or passwords. Azure automatically manages credential creation and rotation.

This is Microsoft’s recommended authentication approach for Azure-hosted applications.


Question 7

A company wants to expose a stored procedure through Data API builder.

Which object type should be configured?

A. Table

B. View

C. Function

D. Stored-procedure

Correct Answer: D

Explanation

When exposing stored procedures through DAB, the entity’s source type should be configured as stored-procedure.

Tables and views are configured using their respective object types.


Question 8

A web application hosted at https://contoso.com calls a Data API builder service hosted at https://api.contoso.com, but the browser blocks the request.

Which feature should be configured?

A. Transparent Data Encryption

B. Always Encrypted

C. Cross-Origin Resource Sharing (CORS)

D. Dynamic Data Masking

Correct Answer: C

Explanation

Because the application and API are hosted on different origins, the browser enforces the Same-Origin Policy. Configuring CORS allows approved origins to access the API.

Database encryption technologies do not affect browser security policies.


Question 9

An organization uses Microsoft Entra ID to authenticate users accessing Data API builder.

What is the primary benefit?

A. Automatic SQL indexing

B. Enterprise identity management with centralized authentication

C. Automatic query optimization

D. Elimination of REST endpoints

Correct Answer: B

Explanation

Microsoft Entra ID provides centralized authentication, Single Sign-On, Conditional Access, Multi-Factor Authentication, and enterprise identity management.

It does not optimize SQL queries or change API functionality.


Question 10

A development team stores its DAB configuration file in Git and uses Azure DevOps pipelines to deploy to Development, Test, and Production.

Which design best supports this deployment strategy?

A. Maintain separate configuration files containing hardcoded credentials for every environment.

B. Store all passwords directly inside the JSON configuration file.

C. Disable authentication during deployment.

D. Store secrets externally using environment variables or Azure Key Vault while using a common configuration file.

Correct Answer: D

Explanation

A single configuration file combined with environment-specific variables or Azure Key Vault simplifies CI/CD deployments while keeping secrets out of source control. This approach follows Microsoft’s security best practices and makes deployments easier to maintain across multiple environments.


Exam Essentials

For the DP-800 exam, be comfortable with the following concepts:

  • Understand the purpose of the data-source, runtime, and entities sections of a DAB configuration file.
  • Know how Data API builder automatically exposes SQL tables, views, and stored procedures as REST and GraphQL APIs.
  • Recognize when to use tables, views, or stored procedures as entities.
  • Understand how REST and GraphQL endpoints are enabled and configured.
  • Know the difference between authentication and authorization.
  • Understand role-based permissions within DAB.
  • Understand why Microsoft recommends Microsoft Entra ID and Managed Identity for production deployments.
  • Know why secrets should be stored in Azure Key Vault or environment variables instead of configuration files.
  • Understand how CORS enables secure browser-based access across different origins.
  • Recognize common Azure hosting options, including Azure App Service, Azure Container Apps, Azure Kubernetes Service (AKS), and Azure Static Web Apps.
  • Be able to identify common configuration and deployment issues, including invalid JSON, missing environment variables, incorrect entity mappings, and permission misconfigurations.

Final DP-800 Takeaways

Data API builder (DAB) is designed to dramatically simplify API development by exposing database objects through configuration rather than custom code. For the DP-800 exam, Microsoft expects candidates to understand how to configure secure, maintainable, and cloud-ready APIs that integrate with Azure SQL Database and other supported data sources.

Pay particular attention to these frequently tested areas:

  • The structure and purpose of the DAB configuration file.
  • Entity definitions and source object mapping.
  • REST versus GraphQL endpoint configuration.
  • Authentication with Microsoft Entra ID.
  • Passwordless access using Managed Identity.
  • Secrets management with Azure Key Vault and environment variables.
  • Role-based authorization and least-privilege access.
  • Secure deployment practices in Azure environments.

Mastering these concepts will prepare you not only for the DP-800 certification exam but also for implementing secure, production-ready Data API builder solutions in real-world Azure environments.


Go to the DP-800 Exam Prep Hub main page

Create configuration files for Data API builder (DAB) – Part 1 (DP-800 Exam Prep)

This post is a part of the DP-800: Developing AI-Enabled Database Solutions Exam Prep Hub.
This topic falls under these sections:
Secure, optimize, and deploy database solutions (35–40%)
   --> Integrate SQL solutions with Azure services
      --> Create configuration files for Data API builder (DAB)


Note that there are 10 practice questions (with answers) at the end of each section to help you solidify your knowledge of the material. Also, there are 4 practice tests with 30 questions each available from the hub's main page below the exam topics section.

Introduction

Modern application development increasingly relies on APIs rather than direct database connectivity. Instead of allowing client applications to connect directly to a SQL database, developers commonly expose database functionality through secure REST or GraphQL APIs. Microsoft Data API builder (DAB) is designed specifically for this purpose.

Data API builder is an open-source Microsoft tool that automatically creates secure REST and GraphQL endpoints over Azure SQL Database, SQL Server, Azure Database for PostgreSQL, Azure Cosmos DB, and several other supported databases—all from a single configuration file.

Rather than writing thousands of lines of API code, developers describe their database and security requirements in a configuration file. DAB then generates the API automatically.

For the DP-800 certification exam, candidates should understand how to:

  • Create DAB configuration files
  • Configure data sources
  • Define entities
  • Configure REST endpoints
  • Configure GraphQL endpoints
  • Secure APIs
  • Configure authentication
  • Deploy DAB in Azure
  • Manage permissions
  • Configure environment-specific settings

What is Data API Builder?

Data API builder (DAB) is a lightweight API engine that exposes database objects as secure REST and GraphQL endpoints.

Instead of building APIs manually using ASP.NET Core or Node.js, developers configure DAB using a JSON configuration file.

Example:

Database Table

Customers

Automatically becomes

REST

GET /api/Customers

GraphQL

query
{
customers
{
CustomerID
Name
}
}

No custom API coding is required.


Why Microsoft Created Data API Builder

Traditional API development often requires developers to:

  • Design endpoints
  • Write controllers
  • Create models
  • Configure authentication
  • Build CRUD operations
  • Handle serialization
  • Create GraphQL schemas
  • Maintain documentation

This can take weeks.

Data API builder automates these tasks through configuration.

Benefits include:

  • Faster development
  • Less code
  • Standardized APIs
  • Secure default behavior
  • Easy Azure deployment
  • Automatic GraphQL support
  • Automatic OpenAPI generation (REST)

Where DAB Fits in Azure Architecture

Application
Data API Builder
Azure SQL Database

Instead of:

Application
ASP.NET API
Business Layer
Repository Layer
Entity Models
Azure SQL

DAB dramatically reduces application complexity.


Configuration-Driven Development

Everything DAB does is controlled through a configuration file.

The configuration file defines:

  • Database connection
  • Authentication
  • API routes
  • GraphQL schema
  • REST routes
  • Permissions
  • Relationships
  • Stored procedures

This makes the API reproducible and source-control friendly.


Creating a Configuration File

A new configuration file can be created using the DAB CLI.

Example

dab init

This generates a starter configuration file.

Example

dab-config.json

This file becomes the central definition of the API.


Typical Configuration File Structure

A simplified configuration looks like this:

{
"data-source": {
},
"runtime": {
},
"entities": {
}
}

Everything inside these three sections controls the behavior of DAB.


Major Sections of the Configuration File

The most important sections are:

  • data-source
  • runtime
  • entities

Each serves a distinct purpose.


The Data Source Section

The data source defines where the database resides.

Example

"data-source": {
}

Typical information includes:

  • Database type
  • Connection string
  • Database name
  • Authentication method

Example database types

  • SQL Server
  • Azure SQL Database
  • PostgreSQL
  • Azure Cosmos DB

Configuring the Database Type

Example

"database-type": "mssql"

Common supported values

  • mssql
  • postgresql
  • cosmosdb

For DP-800, SQL Server and Azure SQL are the primary focus.


Configuring the Connection String

Example

"connection-string": "@env('SQL_CONNECTION_STRING')"

Notice that the connection string references an environment variable rather than storing credentials directly.

This is considered a security best practice.


Why Environment Variables Are Preferred

Avoid this:

"connection-string":
"Server=myserver;
User=admin;
Password=P@ssword123"

Prefer this:

@env("SQL_CONNECTION_STRING")

Benefits include:

  • No passwords in source control
  • Easier deployment
  • Different environments use different values
  • Improved security

Runtime Configuration

The runtime section controls how the API behaves.

Example

"runtime": {
}

This section contains:

  • REST settings
  • GraphQL settings
  • Host configuration
  • Authentication
  • CORS
  • Logging

Runtime REST Configuration

Example

"rest": {
"enabled": true
}

REST endpoints become available automatically.

Example

GET /api/Products

Runtime GraphQL Configuration

Example

"graphql": {
"enabled": true
}

GraphQL becomes available at

/graphql

Runtime Host Configuration

Example

"host": {
"mode": "development"
}

Common modes include

  • Development
  • Production

Production mode disables many development features.


Authentication Configuration

The runtime section also defines authentication.

Example

"authentication": {
}

Authentication options may include:

  • Anonymous
  • Static Web Apps Authentication
  • Microsoft Entra ID
  • JWT
  • OAuth

Why Authentication Matters

Without authentication:

Anyone can access the API.

With authentication:

  • Users are identified
  • Roles are assigned
  • Permissions are enforced
  • Sensitive data remains protected

Authentication is one of the most tested DAB concepts on the DP-800 exam.


Entities

The most important section is the entity configuration.

Entities represent:

  • Tables
  • Views
  • Stored procedures

Example

"entities": {
}

Each entity becomes one or more API endpoints.


Example Entity

"Products": {
}

This creates

REST

/api/Products

GraphQL

products

Configuring the Source Object

Example

"source": {
"object": "dbo.Products",
"type": "table"
}

The object tells DAB which SQL object to expose.

Supported object types include

  • Table
  • View
  • Stored Procedure

Entity REST Configuration

Example

"rest": {
"enabled": true
}

REST endpoints become available automatically.

Examples

GET /api/Products
POST /api/Products
PUT /api/Products
DELETE /api/Products

depending on permissions.


Custom REST Paths

Instead of

/api/Products

you can configure

/api/catalog

Example

"path": "catalog"

This creates cleaner URLs.


Entity GraphQL Configuration

Example

"graphql": {
"enabled": true
}

GraphQL queries become available.

Example

query
{
products
{
ProductID
Name
}
}

Configuring Relationships

DAB can automatically expose database relationships.

Example

Customers
Orders

Relationship

CustomerID

GraphQL can then retrieve

Customer
Orders

in a single query.

This greatly reduces application complexity.


Stored Procedure Support

Entities may expose stored procedures.

Example

"type": "stored-procedure"

Stored procedures are commonly used for

  • Complex business logic
  • Reporting
  • Batch processing
  • Controlled updates

Environment-Specific Configuration

Different environments often require different settings.

Typical environments include:

  • Development
  • Test
  • QA
  • Staging
  • Production

Rather than maintaining separate configuration files, DAB commonly relies on environment variables.

For example:

Development

SQL_CONNECTION_STRING

points to a local SQL Server.

Production

The same variable name points to an Azure SQL Database.

This approach allows the same configuration file to be deployed across environments while changing only the environment variables.


Common Deployment Scenarios

DP-800 candidates should recognize the most common places where Data API builder is hosted.

Azure App Service

A popular option for enterprise applications. DAB runs as a web application and connects securely to Azure SQL Database.

Azure Container Apps

Suitable for containerized deployments that require scalability and simplified management.

Azure Kubernetes Service (AKS)

Used in large enterprise environments requiring orchestration, high availability, and microservices architectures.

Azure Static Web Apps

Frequently paired with DAB to provide secure APIs for modern JavaScript applications.

Local Development

Developers commonly test DAB locally before deploying to Azure.


Security Best Practices When Creating Configuration Files

When creating DAB configuration files, Microsoft recommends several best practices:

  • Never hardcode passwords or connection strings.
  • Store secrets in environment variables or Azure Key Vault.
  • Use Microsoft Entra ID or Managed Identity whenever possible.
  • Grant only the minimum required database permissions.
  • Disable anonymous access unless explicitly required.
  • Expose only the entities that applications need.
  • Restrict CRUD operations based on user roles.
  • Use HTTPS for all deployments.
  • Keep configuration files under source control while excluding secrets.
  • Regularly review and update authentication and authorization settings.

DP-800 Exam Tips

  • Understand that the configuration file is the core of Data API builder.
  • Be able to identify the purpose of the data-source, runtime, and entities sections.
  • Know how to configure REST and GraphQL endpoints.
  • Understand why environment variables are preferred over hardcoded connection strings.
  • Recognize how tables, views, and stored procedures are exposed as entities.
  • Understand how authentication settings affect API security.
  • Be familiar with common Azure hosting options for DAB.
  • Expect scenario-based questions asking which configuration changes are needed to expose or secure database objects.

Go to the DP-800 Exam Prep Hub main page