{
"$schema": "https://github.com/Azure/data-api-builder/releases/download/2.0.1-RC/dab.draft.schema.json",
"data-source": {
"database-type": "mssql",
"connection-string": "@env('DAB_CONNSTRING')"
},
"runtime": {
"rest": { "request-body-strict": false },
"host": {
"mode": "development",
"authentication": { "provider": "Unauthenticated" },
"cors": { "origins": ["*"], "allow-credentials": false }
}
},
"autoentities": {
"default": {
"patterns": {
"include": ["%.%"],
"name": "{schema}_{object}"
},
"permissions": [{ "role": "anonymous", "actions": ["*"] }]
}
}
}
Existing default schema has things (like entities) that make it unusable.
{
"data-source": {
"database-type": "@env('db-type')",
"connection-string": "@env('ConnectionStrings__Database')",
"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
}
},
"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": []
}
}
},
"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"]
}
}
},
"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"]
}
}
},
"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"]
}
}
}
}
}
Expected
Pull
2.0.1-RCand setDAB_CONNSTRINGenvironment variable and auto-config takes over and works.{ "$schema": "https://github.com/Azure/data-api-builder/releases/download/2.0.1-RC/dab.draft.schema.json", "data-source": { "database-type": "mssql", "connection-string": "@env('DAB_CONNSTRING')" }, "runtime": { "rest": { "request-body-strict": false }, "host": { "mode": "development", "authentication": { "provider": "Unauthenticated" }, "cors": { "origins": ["*"], "allow-credentials": false } } }, "autoentities": { "default": { "patterns": { "include": ["%.%"], "name": "{schema}_{object}" }, "permissions": [{ "role": "anonymous", "actions": ["*"] }] } } }Actual
Existing default schema has things (like entities) that make it unusable.
database-typetomssql.connection-stringshould be ""data-source.optionsshould be omited.request-body-strictshould befalseauthentication.providershould beanonymouscors.originsshould be*entitiesshould be omitted (this is the root of the failure)autoentitiesshould be%.%(this is the other root of the error){ "data-source": { "database-type": "@env('db-type')", "connection-string": "@env('ConnectionStrings__Database')", "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 } }, "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": [] } } }, "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"] } } }, "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"] } } }, "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"] } } } } }