Skip to content

Supplement Docker image with default configuration file (dab-config.json) #3160

@Aniruddh25

Description

@Aniruddh25

Problem

The current Docker image does not include a default configuration file, making it less user-friendly for those getting started.

Proposal

  • Add a default configuration file named dab-config.json to the Docker image.
  • The file should be available in a standard location within the image, such as /App/dab-config.json (see the Dockerfile below).
  • The file should contain the following settings:
{
  "$schema": "https://github.com/Azure/data-api-builder/releases/download/v1.7.86-rc/dab.draft.schema.json",
  "data-source": {
    "database-type": "mssql",
    "connection-string": "@env('DAB_CONNSTRING')",
    "options": {
      "set-session-context": false
    }
  },
  "runtime": {
    "rest": {
      "enabled": true,
      "path": "/api",
      "request-body-strict": false
    },
    "graphql": {
      "enabled": true,
      "path": "/graphql",
      "allow-introspection": true
    },
    "mcp": {
      "enabled": true,
      "path": "/mcp"
    },
    "host": {
      "cors": {
        "origins": [],
        "allow-credentials": false
      },
      "authentication": {
        "provider": "Unauthenticated"
      },
      "mode": "development"
    }
  },
  "entities": {},
  "autoentities": {
    "default": {
        "template": {
        "mcp": { "dml-tool": true },
        "rest": { "enabled": true},
        "graphql": { "enabled": true },
        "health": { "enabled": true },
        "cache": {
          "enabled": false
        }
      },
      "permissions": [
        {
          "role": "anonymous",
          "actions": [
           "*"
          ]
        }
      ]
    }
  }
}

Benefit

Including this configuration file will provide immediate guidance for users, improve out-of-the-box experience, and make Docker-based experimentation much easier.

Relevant code locations

Dockerfile
The Docker image is defined by Dockerfile:

FROM mcr.microsoft.com/dotnet/sdk:8.0-cbl-mariner2.0. AS build

WORKDIR /src
COPY [".", "./"]
RUN dotnet build "./src/Service/Azure.DataApiBuilder.Service.csproj" -c Docker -o /out -r linux-x64

FROM mcr.microsoft.com/dotnet/aspnet:8.0-cbl-mariner2.0 AS runtime
COPY --from=build /out /App
WORKDIR /App
ENV ASPNETCORE_URLS=http://+:5000
ENTRYPOINT ["dotnet", "Azure.DataApiBuilder.Service.dll"]

To add the default config, include a line such as:

# Add default dab-config.json to /App in the image
COPY dab-config.json /App/dab-config.json

References in deployment scripts and samples

Please ensure the Docker image has this default config at /App/dab-config.json, and consider documenting override patterns for cloud and local deployments.

Metadata

Metadata

Labels

Type

Projects

Status

Review In Progress

Relationships

None yet

Development

No branches or pull requests

Issue actions