{"id":5765,"date":"2023-03-15T09:00:11","date_gmt":"2023-03-15T16:00:11","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cosmosdb\/?p=5765"},"modified":"2023-03-16T22:23:20","modified_gmt":"2023-03-17T05:23:20","slug":"announcing-data-api-builder-for-azure-cosmos-db","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cosmosdb\/announcing-data-api-builder-for-azure-cosmos-db\/","title":{"rendered":"Announcing Data API builder for Azure Cosmos DB"},"content":{"rendered":"<p><span data-contrast=\"auto\">We are super excited to announce the public preview of Data API builder<\/span><span data-contrast=\"auto\">. A new feature that allows customers to <\/span><span data-contrast=\"auto\">instantly and securely build a <\/span><span data-contrast=\"auto\">GraphQL<\/span><span data-contrast=\"auto\"> API<\/span><span data-contrast=\"auto\"> for Azure Cosmos DB for NoSQL and Azure Cosmos DB for PostgreSQL.<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span style=\"font-size: 18pt;\">A quick look at Data API Builder\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">With Data API Builder, database objects can be exposed via REST or GraphQL endpoints so your data can be accessed on any platform, any language, and any device. Support for Azure SQL, SQL Server, PostgreSQL, MySQL and <\/span><span data-contrast=\"auto\">Azure <\/span><span data-contrast=\"auto\">Cosmos DB provides API developers with an efficiency boost never seen before.<\/span> <span data-contrast=\"auto\">Developers can quickly build GraphQL and REST APIS by self-hosting or integrating Data API builder in their Static Web App, eliminating the effort needed to build custom code. Developers only need to provide basic information for database connection, entities, and permissions in a simple configuration file. Data API Builder can use the configuration file and GraphQL type schema file to generate the GraphQL endpoint to perform CRUD operations on your data. Data API Builder does not support REST endpoint when used with Azure Cosmos DB for NoSQL; instead, you can use the Azure Cosmos DB REST<\/span><a href=\"https:\/\/learn.microsoft.com\/en-us\/rest\/api\/cosmos-db\/\"><span data-contrast=\"auto\"> API.<\/span><\/a><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"none\">\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\"> <a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/03\/dab-architecture-overview.png\"><img decoding=\"async\" class=\" wp-image-5777 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/03\/dab-architecture-overview-300x167.png\" alt=\"Image dab architecture overview\" width=\"638\" height=\"355\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/03\/dab-architecture-overview-300x167.png 300w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/03\/dab-architecture-overview-768x426.png 768w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/03\/dab-architecture-overview.png 1000w\" sizes=\"(max-width: 638px) 100vw, 638px\" \/><\/a><\/span><\/p>\n<p style=\"text-align: center;\"><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:2,&quot;335551620&quot;:2,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><i><span data-contrast=\"auto\">Figure: Data API Builder architecture<\/span><\/i><span data-contrast=\"none\">\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h2><span style=\"font-size: 18pt;\">Features of Data API Builder for Azure Cosmos DB<\/span><\/h2>\n<h5><span data-contrast=\"none\">Build with existing or new databases<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h5>\n<p><span data-contrast=\"none\">Data API Builder gives you the flexibility to build APIs on the data you already have in any of the supported databases and does not require you to store your data in any specific format. It also provides a rich end-to-end developer experience including a CLI which enables rapid development,<\/span><span data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:240}\"><span class=\"NormalTextRun SCXW73352933 BCX8\">\u00a0all you need to do is provide Data API Builder with a connection string and basic schema and permissions information in a simple configuration file. No code is <\/span><span class=\"NormalTextRun SCXW73352933 BCX8\">required<\/span><span class=\"NormalTextRun SCXW73352933 BCX8\">! <\/span><span class=\"NormalTextRun SCXW73352933 BCX8\">Your application will then <\/span><span class=\"NormalTextRun SCXW73352933 BCX8\">have the ability to<\/span><span class=\"NormalTextRun SCXW73352933 BCX8\"> perform CRUD operations securely.<\/span><\/span><\/p>\n<h5><span data-contrast=\"none\">Make powerful queries<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h5>\n<p><span data-contrast=\"none\">Data API Builder for Azure Cosmos DB supports <\/span><span data-contrast=\"none\">querying a single item. Or, using the filter engine you can perform paginated queries for multiple items. Mutations are provided to insert, update, and delete data from your database.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h5><span data-contrast=\"none\">Fine-grained access control<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h5>\n<p><span data-contrast=\"none\">Data API Builder for Azure Cosmos DB allows several levels of data access and authorization depending on the needs of an application. Data API Builder for Azure Databases supports AAD Managed Identity and when integrated with Static Web App, it provides enterprise security and fine-grained access control. To secure data access, you can use the built-in role-based access control with Static Web Apps authentication integration to limit access to your database to certain users or roles.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h5 aria-level=\"1\"><span data-contrast=\"none\">Out of the box integration with Azure Static Web Apps<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;201341983&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h5>\n<p><span data-contrast=\"none\">Data API builder has been tightly integrated into Azure Static Web Apps enabling you to quickly build <\/span><span data-contrast=\"none\">dynamic web apps that scale via the new SWA Database connections feature. It powers you to deploy the entire application with backend connectivity using <\/span><span data-contrast=\"none\">Azure <\/span><span data-contrast=\"none\">Cosmos DB with a simple git push.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p style=\"text-align: center;\"><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\"> <a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/03\/Database-connections.png\"><img decoding=\"async\" class=\" wp-image-5778 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/03\/Database-connections-300x148.png\" alt=\"Image Database connections\" width=\"545\" height=\"269\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/03\/Database-connections-300x148.png 300w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/03\/Database-connections-1024x505.png 1024w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/03\/Database-connections-768x379.png 768w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/03\/Database-connections-1536x757.png 1536w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/03\/Database-connections.png 1852w\" sizes=\"(max-width: 545px) 100vw, 545px\" \/><\/a>Database connections with Azure Static Web Apps<\/span><\/p>\n<p><span data-contrast=\"none\">This is made available in your development environment via the Static Web Apps CLI emulator (SWA CLI) for consistency across development,<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\"> <span class=\"TextRun Highlight SCXW61911120 BCX8\" lang=\"EN-GB\" xml:lang=\"EN-GB\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW61911120 BCX8\">enable you to get <\/span><span class=\"NormalTextRun SCXW61911120 BCX8\">stated<\/span><span class=\"NormalTextRun SCXW61911120 BCX8\"> building <\/span><span class=\"NormalTextRun SCXW61911120 BCX8\">your <\/span><\/span><span class=\"TextRun SCXW61911120 BCX8\" lang=\"EN-GB\" xml:lang=\"EN-GB\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW61911120 BCX8\">apps<\/span><span class=\"NormalTextRun SCXW61911120 BCX8\"> without<\/span><span class=\"NormalTextRun SCXW61911120 BCX8\"> the need to<\/span><span class=\"NormalTextRun SCXW61911120 BCX8\"> wait<\/span><span class=\"NormalTextRun SCXW61911120 BCX8\"> on <\/span><span class=\"NormalTextRun SCXW61911120 BCX8\">or invest in separate <\/span><span class=\"NormalTextRun SCXW61911120 BCX8\">b<\/span><span class=\"NormalTextRun SCXW61911120 BCX8\">ackend <\/span><span class=\"NormalTextRun SCXW61911120 BCX8\">development <\/span><span class=\"NormalTextRun SCXW61911120 BCX8\">effort <\/span><span class=\"NormalTextRun SCXW61911120 BCX8\">needed <\/span><span class=\"NormalTextRun SCXW61911120 BCX8\">to <\/span><span class=\"NormalTextRun SCXW61911120 BCX8\">create <\/span><span class=\"NormalTextRun SCXW61911120 BCX8\">APIs<\/span> <span class=\"NormalTextRun SCXW61911120 BCX8\">fo<\/span><span class=\"NormalTextRun SCXW61911120 BCX8\">r data<\/span><span class=\"NormalTextRun SCXW61911120 BCX8\"> access.<\/span> <\/span><\/span><\/p>\n<h2><span style=\"font-size: 18pt;\">Benefits:\u00a0<\/span><\/h2>\n<ul>\n<li data-leveltext=\"\u00b7\" data-font=\"Symbol\" data-listid=\"5\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\u00b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"1\" data-aria-level=\"1\"><span data-contrast=\"none\">Data API Builder provides <\/span><span data-contrast=\"none\">a <\/span><span data-contrast=\"none\">superior develop<\/span><span data-contrast=\"none\">er <\/span><span data-contrast=\"none\">experience with <\/span><span data-contrast=\"none\">a <\/span><span data-contrast=\"none\">great toolset including CLI. It simplifies the client-side code and enables rapid product development.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\u00b7\" data-font=\"Symbol\" data-listid=\"5\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\u00b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"none\">Declarative data fetching \u2013 The consumer defines the data structure it wants to receive<\/span><span data-contrast=\"none\">,<\/span><span data-contrast=\"none\"> which enables separation of concerns.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\u00b7\" data-font=\"Symbol\" data-listid=\"5\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\u00b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"none\">No more over-fetching and under<\/span><span data-contrast=\"none\">&#8211;<\/span> <span data-contrast=\"none\">fetching \u2013 Consumers ask for exactly what they need and nothing more, which helps avoid multiple round trips to fetch data.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\u00b7\" data-font=\"Symbol\" data-listid=\"5\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\u00b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"none\">Strongly typed <\/span><span data-contrast=\"none\">shema<\/span><span data-contrast=\"none\"> and introspection \u2013 Self documentation of API is based on schema and less error prone as the queries can be validated.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li data-leveltext=\"\u00b7\" data-font=\"Symbol\" data-listid=\"5\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\u00b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" aria-setsize=\"-1\" data-aria-posinset=\"2\" data-aria-level=\"1\"><span data-contrast=\"none\">Language agnostic &#8211; Customers can build applications using Data API Builder with any platform, any language, or any device of their choice.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<h2><span style=\"font-size: 18pt;\">Get started\u00a0<\/span><\/h2>\n<p><span data-contrast=\"none\"><span class=\"NormalTextRun SCXW9041389 BCX8\">If <\/span><span class=\"NormalTextRun SCXW9041389 BCX8\">you&#8217;re<\/span><span class=\"NormalTextRun SCXW9041389 BCX8\"> excited about what Data API Builder can do for you, try it out today!\u00a0<\/span><\/span><\/p>\n<ul>\n<li><span data-contrast=\"none\">Check out \u00a0<\/span><a href=\"https:\/\/aka.ms\/dabdocs\"><span data-contrast=\"none\">documentation<\/span><\/a><span data-contrast=\"none\"> for Data API builder to get started.<\/span><span data-contrast=\"none\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"none\">For integration with Azure Static Web Apps see <\/span><a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/static-web-apps\/database-azure-cosmos-db\"><span data-contrast=\"auto\">Azure Static Web Apps Database Connections<\/span><\/a><span data-contrast=\"none\">.<\/span><\/li>\n<li><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\"> End-to-end samples using the most common frontend frameworks, are available in the <a href=\"https:\/\/github.com\/Azure-Samples\/data-api-builder\">Data API Builder Azure Samples<\/a> .\u00a0<\/span><\/li>\n<\/ul>\n<p><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\"> <span class=\"NormalTextRun SCXW170581105 BCX8\">Let&#8217;s<\/span><span class=\"NormalTextRun SCXW170581105 BCX8\"> build amazing applications with Data API Builder together!<\/span><\/span><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We are super excited to announce the public preview of Data API builder. A new feature that allows customers to instantly and securely build a GraphQL API for Azure Cosmos DB for NoSQL and Azure Cosmos DB for PostgreSQL.\u00a0\u00a0 A quick look at Data API Builder\u00a0 With Data API Builder, database objects can be exposed [&hellip;]<\/p>\n","protected":false},"author":80443,"featured_media":5811,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[14,1838],"tags":[1856,1770,1851,1855,1859,1857,1852,1853,1858,1854],"class_list":["post-5765","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-core-sql-api","category-postgresql","tag-angular","tag-azure-cosmosdb","tag-graphql","tag-jamstack","tag-javascript","tag-react","tag-rest","tag-static-web-apps","tag-vue","tag-web-apps"],"acf":[],"blog_post_summary":"<p>We are super excited to announce the public preview of Data API builder. A new feature that allows customers to instantly and securely build a GraphQL API for Azure Cosmos DB for NoSQL and Azure Cosmos DB for PostgreSQL.\u00a0\u00a0 A quick look at Data API Builder\u00a0 With Data API Builder, database objects can be exposed [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts\/5765","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/users\/80443"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/comments?post=5765"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts\/5765\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/media\/5811"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/media?parent=5765"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/categories?post=5765"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/tags?post=5765"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}