Skip to content

Fix default config and improve logging for debuggability#3597

Open
Aniruddh25 wants to merge 11 commits into
mainfrom
dev/anmunde/fixDefaultConfig
Open

Fix default config and improve logging for debuggability#3597
Aniruddh25 wants to merge 11 commits into
mainfrom
dev/anmunde/fixDefaultConfig

Conversation

@Aniruddh25
Copy link
Copy Markdown
Collaborator

@Aniruddh25 Aniruddh25 commented May 16, 2026

Why make this change?

What is this change?

Configuration and Environment Variable Changes:

  • Changed environment variable for database connection strings from ConnectionStrings__Database to DAB_CONNSTRING throughout the codebase, ensuring consistency and aligning with Data API Builder conventions (src/Aspire.AppHost/AppHost.cs, src/Service/dab-config.json). [1] [2] [3]
  • Set the database type explicitly to mssql in dab-config.json instead of using an environment variable, simplifying configuration for local development (src/Service/dab-config.json).

Entity Management Simplification:

  • Removed explicit entity definitions and relationships in favor of autoentities with a default pattern that includes all schema objects, drastically reducing manual configuration and making the setup more maintainable (dab-config.json, src/Service/dab-config.json). [1] [2]
  • Added a pattern in autoentities to automatically include all objects and generate entity names in the format {schema}_{object} (dab-config.json, src/Service/dab-config.json). [1] [2]

Access and Security Relaxations for Development:

  • Updated CORS settings to allow all origins by default, making APIs accessible from any client during development (dab-config.json, src/Service/dab-config.json). [1] [2]
  • Changed authentication provider to Unauthenticated and allowed all actions for the anonymous role, making the API open by default for easier testing (dab-config.json, src/Service/dab-config.json). [1] [2]

Minor Improvements:

  • Improved error messaging for GraphQL name violations by including the entity name in the exception message (src/Core/Services/MetadataProviders/SqlMetadataProvider.cs).
  • Disabled strict request body validation for REST endpoints to allow more flexible payloads during development (src/Service/dab-config.json).

How was this tested?

  • Used the default config to start dab on a local SQL Server and ensured all endpoints were working. Once merged, will build a test docker image from internal buddy pipeline to verify inclusion.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the unusable default dab-config.json shipped in the official Docker image by replacing the Aspire-specific config at src/Service/dab-config.json (the file actually picked up during the official image build) with a generic, autoentities-based config. Also standardizes the DB connection-string environment variable name and improves a GraphQL name-violation error message.

Changes:

  • Replace entity-specific dev config in src/Service/dab-config.json with a generic mssql + autoentities config matching the repo-root dab-config.json.
  • Rename ConnectionStrings__Database to DAB_CONNSTRING in Aspire AppHost wiring, and relax the root dab-config.json (CORS *, anonymous *, autoentities pattern).
  • Include entity name in the GraphQL column name-violation error message for better debuggability.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/Service/dab-config.json Replaces Aspire-specific entity config with generic mssql/autoentities config baked into the Docker image.
dab-config.json Adds autoentities.patterns, opens CORS to *, and broadens anonymous permissions to *.
src/Aspire.AppHost/AppHost.cs Renames the connection-string env var to DAB_CONNSTRING for both mssql and pg services.
src/Core/Services/MetadataProviders/SqlMetadataProvider.cs Adds entity name to the GraphQL column name-violation exception message.

Comment thread src/Service/dab-config.json
Copy link
Copy Markdown
Contributor

@souvikghosh04 souvikghosh04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might need to fix the Docker file and config appropriately

Comment thread Dockerfile
Comment thread src/Service/dab-config.json
Comment thread src/Service/dab-config.json
Comment thread src/Service/dab-config.json
Comment thread src/Core/Services/MetadataProviders/SqlMetadataProvider.cs Outdated
Comment thread src/Core/Services/MetadataProviders/SqlMetadataProvider.cs Outdated
Enclose in single quotes

Co-authored-by: Aniruddh Munde <anmunde@microsoft.com>
@Aniruddh25 Aniruddh25 enabled auto-merge (squash) May 18, 2026 20:22
Copy link
Copy Markdown
Contributor

@souvikghosh04 souvikghosh04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. thanks for addressing the comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Review In Progress

Development

Successfully merging this pull request may close these issues.

[Bug]: Critical! Default image config is not usable. Change SqlMetadataProvider Exception message

5 participants