{"id":6565,"date":"2026-02-20T09:30:27","date_gmt":"2026-02-20T17:30:27","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/azure-sql\/?p=6565"},"modified":"2026-02-20T09:30:27","modified_gmt":"2026-02-20T17:30:27","slug":"multi-source-data-api-builder","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/azure-sql\/multi-source-data-api-builder\/","title":{"rendered":"Light up Multiple Databases with a Single API with Data API builder&#8217;s multi-source configuration"},"content":{"rendered":"<h1>Data API builder (DAB) supports multi-source configurations<\/h1>\n<p>Data API builder (DAB) connects to your database with a safe REST or GraphQL endpoint. But DAB is not limited to just one database. Using a multi-source configuration, you can connect to more than one database simultaneously.<\/p>\n<blockquote>\n<p>Learn more about Data API builder: <a href=\"https:\/\/aka.ms\/dab\/docs\">https:\/\/aka.ms\/dab\/docs<\/a><\/p>\n<\/blockquote>\n<h2>Multi-source configuration<\/h2>\n<p>A multi-source configuration is one of DAB&#8217;s most powerful features. There is no special requirement other than a valid connection string. This lets multiple databases take advantage of a single instance of DAB with REST and GraphQL, but also its new MCP endpoint for agentic applications.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2026\/02\/multi-config-dab.drawio.svg\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2026\/02\/multi-config-dab.drawio.svg\" alt=\"Multi-source configuration in Data API builder\" class=\"aligncenter size-full wp-image-6468\"\n style=\"width:100%; height:auto;\"\n role=\"img\" \/><\/a><\/p>\n<p>Just like Data API builder&#8217;s single-source configuration, multi-source config isn&#8217;t code generation and doesn&#8217;t require writing any code. It&#8217;s a dynamic engine you control with JSON files that gives you the feature-rich API experience most development teams demand but budgets and timelines often can&#8217;t deliver. Build for developer velocity and convenience, Data API builder can deliver secure, robust endpoints by the end of lunch.<\/p>\n<blockquote>\n<p>Working demo: <a href=\"https:\/\/github.com\/JerryNixon\/dab-multi-source-demo\">https:\/\/github.com<\/a><\/p>\n<\/blockquote>\n<hr \/>\n<h2>One config to rule them all<\/h2>\n<p>Data API builder uses a JSON-formatted configuration file, often named <code>dab-config.json<\/code> though the name doesn&#8217;t matter, to connect to your database. In a multi-source scenario, Data API builder uses one configuration file for each database.<\/p>\n<blockquote>\n<p>There is only one DAB configuration format. Every configuration will be basically the same except for a specific connection string and entity settings. See the DAB configuration schema: <a href=\"https:\/\/github.com\/Azure\/data-api-builder\/blob\/main\/schemas\/dab.draft.schema.json\">https:\/\/github.com<\/a><\/p>\n<\/blockquote>\n<p>You only give Data API builder a single configuration file. This file is the parent configuration, and it points to the child configurations with the <code>data-source-files<\/code> property. The engine merges them together at runtime to create a single API surface across all databases.<\/p>\n<h4>Example use of <code>data-source-files<\/code>:<\/h4>\n<pre><code class=\"json\">{\n  \"data-source-files\": [\n    \"dab-config-catalog.json\",\n    \"dab-config-inventory.json\",\n    \"dab-config-recommendations.json\"\n  ]\n}\n<\/code><\/pre>\n<p>Read Data API builder&#8217;s documentation: <a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/data-api-builder\/concept\/config\/multi-data-source\">MS Learn<\/a><\/p>\n<h3>Just one runtime<\/h3>\n<p>The parent configuration file can include entity definitions, but that is optional. What is required, however, is <code>runtime<\/code>. The parent configuration file&#8217;s <code>runtime<\/code> settings are the only <code>runtime<\/code> settings the engine obeys. This means settings like <code>authentication<\/code>, <code>authorization<\/code>, and <code>caching<\/code> are global across all data sources.<\/p>\n<blockquote>\n<p>If a child configuration file includes a <code>runtime<\/code> section, the engine ignores it and logs a warning. Only the parent configuration file&#8217;s <code>runtime<\/code> section is used.<\/p>\n<\/blockquote>\n<h3>As many as you need<\/h3>\n<p>There is no limit to the number of child configuration files you can have, and there is no requirement for how many entities each one defines. You can have one child configuration with 50 entities and another with just one entity. The engine doesn&#8217;t care.<\/p>\n<h3>Any type you need<\/h3>\n<p>Multi-source config is not limited to SQL Server. You can connect to any supported database in any combination. For example, you could have one child config connecting to SQL Server and another connecting to Cosmos DB, and the API would serve them both seamlessly.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2026\/02\/dab-supported-databases.svg\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2026\/02\/dab-supported-databases.svg\" alt=\"Data APi builder supported databases\" class=\"aligncenter size-full wp-image-6468\"\n style=\"width:100%; height:auto;\"\n role=\"img\" \/><\/a><\/p>\n<h3>Important limits<\/h3>\n<p>However, across data sources, entity names must be unique. You can&#8217;t have a <code>products<\/code> entity in two different child configuration files. If you do, the engine throws an error at startup and doesn&#8217;t run. This is also true with GraphQL type names and REST paths. For a single DAB instance to serve multiple databases, it needs a single unified namespace.<\/p>\n<blockquote>\n<p>Learn more about multi-source config: <a href=\"https:\/\/aka.ms\/dab\/docs\">https:\/\/aka.ms\/dab\/docs<\/a><\/p>\n<\/blockquote>\n<hr \/>\n<h2>Try it out<\/h2>\n<p>The demo associated to this blog post uses a retail scenario spread across three SQL Server databases. The first database has product catalog information, the second has inventory information, and the third has user-specific recommendations.<\/p>\n<pre><code>CatalogDb \u2192 Products and Pricing\nInventoryDb \u2192 Inventory and Warehouse\nRecommendationsDb \u2192 Recommendations and Ratings\n<\/code><\/pre>\n<h3>GraphQL special behavior<\/h3>\n<p>The API merges each data source together so the client can get a product&#8217;s details, availability, and personalized recommendation in one API surface. However, there is magic when the developer uses GraphQL, in a single request, they can get all three databases&#8217; information merged together in one response.<\/p>\n<p>An example of a unifying GraphQL request\/query:<\/p>\n<pre><code class=\"graphql\">{\n  products { items { ProductId Name Category Price } }\n  inventories { items { ProductId StockCount Warehouse } }\n  recommendations { items { UserId ProductId Score } }\n}\n<\/code><\/pre>\n<p>An example of a unifying GraphQL response:<\/p>\n<pre><code class=\"json\">{\n  \"data\": {\n    \"products\": {\n      \"items\": [\n        { \"ProductId\": 1, \"Name\": \"Widget\", \"Category\": \"Gadgets\", \"Price\": 19.99 },\n        { \"ProductId\": 2, \"Name\": \"Gizmo\", \"Category\": \"Gadgets\", \"Price\": 29.99 }\n      ]\n    },\n    \"inventories\": {\n      \"items\": [\n        { \"ProductId\": 1, \"StockCount\": 100, \"Warehouse\": \"A\" },\n        { \"ProductId\": 2, \"StockCount\": 50, \"Warehouse\": \"B\" }\n      ]\n    },\n    \"recommendations\": {\n      \"items\": [\n        { \"UserId\": 123, \"ProductId\": 1, \"Score\": 4.5 },\n        { \"UserId\": 123, \"ProductId\": 2, \"Score\": 3.8 }\n      ]\n    }\n  }\n}\n<\/code><\/pre>\n<h3>Agentic applications<\/h3>\n<p>In addition to REST and GraphQL, the same multi-source configuration also feeds DAB&#8217;s new MCP endpoint. This means agents can access all three databases through a single surface without needing custom middleware or a custom server.<\/p>\n<blockquote>\n<p>Learn more about Aspire: <a href=\"https:\/\/aspire.dev\">https:\/\/aspire.dev<\/a><\/p>\n<\/blockquote>\n<p>The demo includes the MCP Inspector wired into Aspire, so you can see it in action. You can also connect an actual agent to it, like Copilot or Claude, to see it work in a real-world scenario.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2026\/02\/aspire-demo.webp\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2026\/02\/aspire-demo.webp\" alt=\"Aspire Dashboard\" class=\"aligncenter size-full wp-image-6468\"\n style=\"width:100%; height:auto;\"\n role=\"img\" \/><\/a><\/p>\n<h2>Conclusion<\/h2>\n<p>Multi-source configuration makes what could be a complicated solution, a simple one. It transforms a single instance of Data API builder in to a pwoerful Data API. Consider the engineering cost and time to build this yourself. Data API builder gives developers the pre-built solutions that both save them time and let them delete huge swaths of code from their codebases. Especially with multi-source config, you get a lot without writing a single line of code.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Data API builder (DAB) supports multi-source configurations Data API builder (DAB) connects to your database with a safe REST or GraphQL endpoint. But DAB is not limited to just one database. Using a multi-source configuration, you can connect to more than one database simultaneously. Learn more about Data API builder: https:\/\/aka.ms\/dab\/docs Multi-source configuration A multi-source [&hellip;]<\/p>\n","protected":false},"author":96788,"featured_media":6582,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,597],"tags":[409,719,510,560],"class_list":["post-6565","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure-sql","category-data-api-builder-2","tag-api","tag-architecture","tag-azure-sql-database","tag-data-api-builder"],"acf":[],"blog_post_summary":"<p>Data API builder (DAB) supports multi-source configurations Data API builder (DAB) connects to your database with a safe REST or GraphQL endpoint. But DAB is not limited to just one database. Using a multi-source configuration, you can connect to more than one database simultaneously. Learn more about Data API builder: https:\/\/aka.ms\/dab\/docs Multi-source configuration A multi-source [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/posts\/6565","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/users\/96788"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/comments?post=6565"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/posts\/6565\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/media\/6582"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/media?parent=6565"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/categories?post=6565"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/tags?post=6565"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}