Fix default config and improve logging for debuggability#3597
Fix default config and improve logging for debuggability#3597Aniruddh25 wants to merge 12 commits into
Conversation
There was a problem hiding this comment.
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.jsonwith a generic mssql + autoentities config matching the repo-rootdab-config.json. - Rename
ConnectionStrings__DatabasetoDAB_CONNSTRINGin Aspire AppHost wiring, and relax the rootdab-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. |
souvikghosh04
left a comment
There was a problem hiding this comment.
we might need to fix the Docker file and config appropriately
…re/data-api-builder into dev/anmunde/fixDefaultConfig
Enclose in single quotes Co-authored-by: Aniruddh Munde <anmunde@microsoft.com>
souvikghosh04
left a comment
There was a problem hiding this comment.
LGTM. thanks for addressing the comments
aaronburtle
left a comment
There was a problem hiding this comment.
Looks good, just a question about the hard coded mssql db-type.
Why make this change?
src/Serviceand replace the unusable previous dab-config.json that was specific to Aspire project. This way the generic dab-config gets copied into the publish folder and lands in the official docker imageWhat is this change?
Configuration and Environment Variable Changes:
ConnectionStrings__DatabasetoDAB_CONNSTRINGthroughout the codebase, ensuring consistency and aligning with Data API Builder conventions (src/Aspire.AppHost/AppHost.cs,src/Service/dab-config.json). [1] [2] [3]mssqlindab-config.jsoninstead of using an environment variable, simplifying configuration for local development (src/Service/dab-config.json).Entity Management Simplification:
autoentitieswith 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]autoentitiesto 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:
dab-config.json,src/Service/dab-config.json). [1] [2]Unauthenticatedand allowed all actions for theanonymousrole, making the API open by default for easier testing (dab-config.json,src/Service/dab-config.json). [1] [2]Minor Improvements:
src/Core/Services/MetadataProviders/SqlMetadataProvider.cs).src/Service/dab-config.json).How was this tested?