Azure / Azure/data-api-builder

[Bug]: Multiple Source Files Config not loading

Open
#2,979 4 comments 3 reactions 2 assignees Claimed by @JerryNixon View on GitHub
bug cri has-pr triage
Dominant language
C#
Stars
1.5k
Forks
370
Avg merge
3d 17h
Merged PRs (30d)
8

Description

### What happened?

As per documentation found here: https://learn.microsoft.com/en-us/azure/data-api-builder/concept/config/multi-data-source we have set up a overarching dab-config.json file with a file in the same directory dab-config-sql.json

The child file contains the appropriate data source and entities information. We have also included runtime information in the child file for troubleshooting purposes. The dab-config.json file contains the data source parameter and runtime information.

DAB seems to not be able to parse the data-source-files parameter and always errors with "data-source is a mandatory property in DAB config"

If running DAB Start -c dab-config-sql.json at the child file DAB start's with no issues proving the config is working appropriately.

Ultimately we want this to be deployed to an App Service however would like to confirm the viability of multiple config files for our use case locally.

### Version

1.5.56

### What database are you using?

Azure SQL

### What hosting model are you using?

Local (including CLI)

### Which API approach are you accessing DAB through?

REST

### Relevant log output

```Text
Information: Microsoft.DataApiBuilder 1.5.56
Information: Config not provided. Trying to get default config based on DAB_ENVIRONMENT...
Information: Environment variable DAB_ENVIRONMENT is (null)
Loading config file from C:\Users\User\DataApiBuilderAppProject\dab-config.json.
Deserialization of the configuration file failed during a post-processing step.
Message:
data-source is a mandatory property in DAB Config
Stack Trace:
at Azure.DataApiBuilder.Config.ObjectModel.RuntimeConfig..ctor(String Schema, DataSource DataSource, RuntimeEntities Entities, RuntimeOptions Runtime, DataSourceFiles DataSourceFiles) in /_/src/Config/ObjectModel/RuntimeConfig.cs:line 229
at .ctor(Object[])
at System.Text.Json.Serialization.Converters.LargeObjectWithParameterizedConstructorConverter`1.CreateObject(ReadStackFrame& frame)
at System.Text.Json.Serialization.Converters.ObjectWithParameterizedConstructorConverter`1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, T& value, JsonSerializerOptions options, ReadStack& state)
at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.Deserialize(Utf8JsonReader& reader, ReadStack& state)
at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan`1 utf8Json, JsonTypeInfo`1 jsonTypeInfo, Nullable`1 actualByteCount)
at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan`1 json, JsonTypeInfo`1 jsonTypeInfo)
at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
at Azure.DataApiBuilder.Config.RuntimeConfigLoader.TryParseConfig(String json, RuntimeConfig& config, ILogger logger, String connectionString, Boolean replaceEnvVar, EnvironmentVariableReplacementFailureMode replacementFailureMode) in /_/src/Config/RuntimeConfigLoader.cs:line 154
Error: Failed to parse the config file: dab-config.json.
Error: Failed to start the engine.
```

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.