Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Version values referenced from https://hub.docker.com/_/microsoft-dotnet-aspnet

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


WORKDIR /src
Expand All @@ -11,7 +11,7 @@ FROM mcr.microsoft.com/dotnet/aspnet:8.0-cbl-mariner2.0 AS runtime

COPY --from=build /out /App
# Add default dab-config.json to /App in the image
COPY dab-config.json /App/dab-config.json
COPY --from=build /out/dab-config.json /App/dab-config.json
WORKDIR /App
ENV ASPNETCORE_URLS=http://+:5000
ENTRYPOINT ["dotnet", "Azure.DataApiBuilder.Service.dll"]
58 changes: 0 additions & 58 deletions dab-config.json

This file was deleted.

8 changes: 4 additions & 4 deletions src/Aspire.AppHost/AppHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@

if (sqlDbContainer is null)
{
mssqlService.WithEnvironment("ConnectionStrings__Database", databaseConnectionString);
mssqlService.WithEnvironment("DAB_CONNSTRING", databaseConnectionString);
}
else
{
mssqlService.WithEnvironment("ConnectionStrings__Database", sqlDbContainer)
mssqlService.WithEnvironment("DAB_CONNSTRING", sqlDbContainer)
.WaitFor(sqlDbContainer);
}

Expand Down Expand Up @@ -79,11 +79,11 @@

if (postgresDB is null)
{
pgService.WithEnvironment("ConnectionStrings__Database", databaseConnectionString);
pgService.WithEnvironment("DAB_CONNSTRING", databaseConnectionString);
}
else
{
pgService.WithEnvironment("ConnectionStrings__Database", postgresDB)
pgService.WithEnvironment("DAB_CONNSTRING", postgresDB)
.WaitFor(postgresDB);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1478,7 +1478,7 @@ private async Task PopulateSourceDefinitionAsync(
&& IsGraphQLReservedName(entity, columnName, graphQLEnabledGlobally: runtimeConfig.IsGraphQLEnabled))
{
throw new DataApiBuilderException(
message: $"The column '{columnName}' violates GraphQL name restrictions.",
message: $"The column '{columnName}' from {entityName} violates GraphQL name restrictions.",
statusCode: HttpStatusCode.ServiceUnavailable,
subStatusCode: DataApiBuilderException.SubStatusCodes.ErrorInInitialization);
}
Expand Down
264 changes: 47 additions & 217 deletions src/Service/dab-config.json
Original file line number Diff line number Diff line change
@@ -1,231 +1,61 @@
{
"$schema": "https://github.com/Azure/data-api-builder/releases/latest/download/dab.draft.schema.json",
"data-source": {
"database-type": "@env('db-type')",
"connection-string": "@env('ConnectionStrings__Database')",
"database-type": "mssql",
Comment thread
Aniruddh25 marked this conversation as resolved.
"connection-string": "@env('DAB_CONNSTRING')",
"options": {
"set-session-context": false
}
},
"runtime": {
"rest": {
"enabled": true,
"path": "/api",
"request-body-strict": true
},
"graphql": {
"enabled": true,
"path": "/graphql",
"allow-introspection": true
},
"host": {
"authentication": {
"provider": "StaticWebApps"
},
"cors": {
"origins": [],
"allow-credentials": false
},
"mode": "development"
},
"telemetry": {
"open-telemetry": {
"enabled": true,
"endpoint": "@env('OTEL_EXPORTER_OTLP_ENDPOINT')",
"headers": "@env('OTEL_EXPORTER_OTLP_HEADERS')",
"exporter-protocol": "@env('OTEL_EXPORTER_OTLP_PROTOCOL')",
"service-name": "@env('OTEL_SERVICE_NAME')"
}
},
"cache": {
"enabled": true,
"ttl-seconds": 60
}
"runtime": {
"rest": {
"enabled": true,
"path": "/api",
"request-body-strict": false
},
"entities": {
"Actor": {
"source": {
"object": "Actor",
"type": "table"
},
"graphql": {
"enabled": true,
"type": {
"singular": "Actor",
"plural": "Actors"
}
},
"rest": {
"enabled": true
},
"permissions": [
{
"role": "anonymous",
"actions": [
"*"
]
}
],
"relationships": {
"character": {
"cardinality": "many",
"target.entity": "Character",
"source.fields": [
"Id"
],
"target.fields": [
"ActorId"
],
"linking.source.fields": [],
"linking.target.fields": []
}
}
"graphql": {
"enabled": true,
"path": "/graphql",
"allow-introspection": true
},
"mcp": {
"enabled": true,
"path": "/mcp"
},
"host": {
"cors": {
"origins": ["*"],
"allow-credentials": false
},
"Character": {
"source": {
"object": "Character",
"type": "table"
},
"graphql": {
"enabled": true,
"type": {
"singular": "Character",
"plural": "Characters"
}
},
"rest": {
"enabled": true
},
"permissions": [
{
"role": "anonymous",
"actions": [
{
"action": "*"
}
]
}
],
"relationships": {
"actor": {
"cardinality": "one",
"target.entity": "Actor",
"source.fields": [
"ActorId"
],
"target.fields": [
"Id"
],
"linking.source.fields": [],
"linking.target.fields": []
},
"series": {
"cardinality": "many",
"target.entity": "Series",
"source.fields": [
"Id"
],
"target.fields": [
"Id"
],
"linking.object": "series_character",
"linking.source.fields": [
"CharacterId"
],
"linking.target.fields": [
"SeriesId"
]
}
}
"authentication": {
"provider": "Unauthenticated"
},
"mode": "development"
}
},
"autoentities": {
"default": {
"patterns": {
"include": ["%.%"],
"name": "{schema}_{object}"
},
"Series": {
"source": {
"object": "Series",
"type": "table"
},
"graphql": {
"enabled": true,
"type": {
"singular": "Series",
"plural": "Series"
}
},
"rest": {
"enabled": true
},
"permissions": [
{
"role": "anonymous",
"actions": [
{
"action": "*"
}
]
}
],
"relationships": {
"character": {
"cardinality": "many",
"target.entity": "Character",
"source.fields": [
"Id"
],
"target.fields": [
"Id"
],
"linking.object": "series_character",
"linking.source.fields": [
"SeriesId"
],
"linking.target.fields": [
"CharacterId"
]
}
"template": {
"mcp": { "dml-tools": true },
"rest": { "enabled": true },
"graphql": { "enabled": true },
"health": { "enabled": true },
"cache": {
"enabled": false
}
},
"Species": {
"source": {
"object": "Species",
"type": "table"
},
"graphql": {
"enabled": true,
"type": {
"singular": "Species",
"plural": "Species"
}
},
"rest": {
"enabled": true
},
"permissions": [
{
"role": "anonymous",
"actions": [
{
"action": "*"
}
]
}
],
"relationships": {
"character": {
"cardinality": "many",
"target.entity": "Character",
"source.fields": [
"Id"
],
"target.fields": [
"Id"
],
"linking.object": "character_species",
"linking.source.fields": [
"SpeciesId"
],
"linking.target.fields": [
"CharacterId"
]
}
"permissions": [
{
"role": "anonymous",
"actions": [
"*"
]
}
}
]
}
}
}
Loading