You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Multi Datasource rest and swagger not working #3638
Hello, I have tried a couple different versions of creating a multi datasource configuration. I have two databases, that I want to use one DAB instance to span across (not joining data or anything, just exposing endpoints for the two databases). I have deployed this in a test/dev environment and I have swagger picking up the entities in the second config (datasource and entities only in this one) file but is not picking up the methods available. That said, when I try to post to a couple of the tables to do inserts I get 500 errors, but the stored procedure calls work fine and the reads seem to work fine.
Yes — one DAB instance can serve multiple databases. Each database goes in its own config file, linked from a root config via data-source-files. I validated this with Microsoft.DataApiBuilder 2.0.9.
What works: reads, stored procedures, and Swagger/OpenAPI across both databases.
The bug you hit:POST/PUT/PATCH/DELETE on a table in a linked file returns HTTP 500. I reproduced it and confirmed the cause is positional — the same table writes fine in the root config and fails in a linked file. Reads and stored procedures are unaffected because they don't use the table-mutation path.
Workaround (pick one, until fixed)
Put writable tables in the root config, read-only tables in linked files. Simplest if only one DB needs writes.
Run one DAB instance per database behind a single gateway/reverse proxy (APIM, App Gateway, nginx, YARP). Full CRUD on every table, one API surface. Best when both DBs need writes.
Expose writes as stored procedures — works, but only worth it if you must keep a single multi-source instance.
Activity
pontiusmatt commentedon Jun 9, 2026
Just confirming - I am seeing the same behaivor in 2.0.8 version of DAB as well
pontiusmatt commentedon Jun 9, 2026
Also - the API approach we are trying to use is the REST api.
pontiusmatt commentedon Jun 15, 2026
Is anyone else running into this issue or am I potentially doing something wrong?
JerryNixon commentedon Jul 7, 2026
Confirmed.
JerryNixon commentedon Jul 7, 2026
Hi,
Yes — one DAB instance can serve multiple databases. Each database goes in its own config file, linked from a root config via
data-source-files. I validated this withMicrosoft.DataApiBuilder 2.0.9.What works: reads, stored procedures, and Swagger/OpenAPI across both databases.
The bug you hit:
POST/PUT/PATCH/DELETEon a table in a linked file returns HTTP 500. I reproduced it and confirmed the cause is positional — the same table writes fine in the root config and fails in a linked file. Reads and stored procedures are unaffected because they don't use the table-mutation path.Workaround (pick one, until fixed)
data-source-filesconfig #3701