{"id":1783,"date":"2023-03-15T09:00:10","date_gmt":"2023-03-15T16:00:10","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/azure-sql\/?p=1783"},"modified":"2023-03-15T08:24:45","modified_gmt":"2023-03-15T15:24:45","slug":"data-api-builder-for-azure-sql-databases-public-preview","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/azure-sql\/data-api-builder-for-azure-sql-databases-public-preview\/","title":{"rendered":"Data API builder for Azure SQL Databases &#8211; Public Preview"},"content":{"rendered":"<p>I am extremely happy and excited to announce the public preview of Data API builder for Azure SQL Databases. Data API builder is a new product that we are adding to the developer\u2019s toolset to help every developer to be more efficient and effective, by instantly and securely turning Azure SQL Databases into a modern REST and GraphQL API.<\/p>\n<h2>Turn Azure SQL databases into APIs<\/h2>\n<p>Thanks to Data API builder, tables, views, and stored procedures objects can be turned into REST and GraphQL API instantly, so that data can be accessed using modern techniques on any platform, any language, and any device, using modern and well know web protocols.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2023\/03\/dab-architecture-overview.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-1787\" src=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2023\/03\/dab-architecture-overview.png\" alt=\"Data API builder architecture overview\" width=\"1291\" height=\"717\" srcset=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2023\/03\/dab-architecture-overview.png 1291w, https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2023\/03\/dab-architecture-overview-300x167.png 300w, https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2023\/03\/dab-architecture-overview-1024x569.png 1024w, https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2023\/03\/dab-architecture-overview-768x427.png 768w\" sizes=\"(max-width: 1291px) 100vw, 1291px\" \/><\/a><\/p>\n<p>Data API builder can be used on any new or existing databases, without any special requirement or changes needed on the database.<\/p>\n<h2>Works offline<\/h2>\n<p>Data API builder works offline to provide a full and rich offline development experience. It can work with local SQL Servers or Azure SQL Emulators so that anything can be done offline for the maximum comfort.<\/p>\n<p>Like any modern development tools, it has a dedicated CLI, the Data API builder (DAB) CLI, that allows you to run Data API builder on your machine and manage everything needed to have Data API builder up and running locally. In fact, aside the SQL Server or Azure SQL database, a configuration file is all you need:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">dab init --database-type mssql --connection-string \"@env('AZURE_SQL_CONNSTR')\"\r\ndab add Book --source dbo.books --permissions \"anonymous:*\"\r\ndab start<\/code><\/pre>\n<p>Data API builder is a .NET core (so it runs on any OS: Windows, Linux and MacOS) application and is distributed via NuGet, so that it can be installed using dotnet tool. Just run:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">dotnet tool install --global Microsoft.DataApiBuilder<\/code><\/pre>\n<p>and you will be good to go.<\/p>\n<h2>Open Source<\/h2>\n<p>Data API builder is open source. We want everyone to be able to use and take advantage of Data API builder, as we love developers, and we want them able to do more with the time they have at their hands. Let Data API builder take care of exposing SQL Server or Azure SQL database as GraphQL and REST API so that you can focus on building amazing user experiences and architectures.<\/p>\n<p>We also love the community, as the #sqlfamily hashtag has clearly shown over the years, and we want to make sure Data API builder is built with a strong sense of community, so that we can make Data API builder an excellent product for everyone, together.<\/p>\n<p>Source code is available here:\u00a0<a href=\"https:\/\/aka.ms\/dab\">https:\/\/aka.ms\/dab<\/a><\/p>\n<h2>Run Data API builder on Azure<\/h2>\n<p>Being a .NET Core application, deployment on Azure is amazingly simple and can be done by taking advantage of the container image you can find here:<\/p>\n<p><a href=\"https:\/\/mcr.microsoft.com\/en-us\/product\/azure-databases\/data-api-builder\/about\">https:\/\/mcr.microsoft.com\/en-us\/product\/azure-databases\/data-api-builder\/about<\/a><\/p>\n<p>Using services like Azure Container Instances, Azure Kubernetes Service or even Azure Web App, Data API builder can run on Azure using the container solution you prefer.<\/p>\n<h2>Integrated with Static Web App<\/h2>\n<p>Azure Data API builder for Azure SQL Databases is integrated with <a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/static-web-apps\/overview\">Azure Static Web App<\/a> (SWA), through the new <a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/static-web-apps\/database-overview\">Database Connection<\/a> feature: deploying the entire backend to connect to your favorite database using REST or GraphQL is just a <em>git push<\/em> away.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2023\/03\/Picture1.png\"><img decoding=\"async\" class=\"wp-image-1790 size-full\" src=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2023\/03\/Picture1.png\" alt=\"Image Picture1\" width=\"1605\" height=\"732\" srcset=\"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2023\/03\/Picture1.png 1605w, https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2023\/03\/Picture1-300x137.png 300w, https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2023\/03\/Picture1-1024x467.png 1024w, https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2023\/03\/Picture1-768x350.png 768w, https:\/\/devblogs.microsoft.com\/azure-sql\/wp-content\/uploads\/sites\/56\/2023\/03\/Picture1-1536x701.png 1536w\" sizes=\"(max-width: 1605px) 100vw, 1605px\" \/><\/a><\/p>\n<p>Data API builder is fully integrated also with the offline development experience provided by SWA via the SWA CLI, so that you can create a complete fullstack solution completely offline, test it on your local machine and push it into production using well-established DevOps workflows via GitHub actions.<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\"> swa start --data-api-location .\/swa-db-connections<\/code><\/pre>\n<h2>Getting started<\/h2>\n<p>If you want to try it out right away, a full working example is available here: <a href=\"https:\/\/github.com\/Azure-Samples\/dab-swa-todo\">ToDo App with Data API builder, Static Web Apps and Azure SQL<\/a>. It contains anything needed for a jamstack application: frontend using Vue3, backend using Data API builder and the Azure SQL Database projects.<\/p>\n<p>Full documentation with a complete Getting Started guide is available here: <a href=\"https:\/\/aka.ms\/dabdocs\">https:\/\/aka.ms\/dabdocs<\/a>.<\/p>\n<h2>Contribute<\/h2>\n<p>Data API builder is Open Source, and we are thrilled for getting your ideas and feedback on how to improve Data API builder. Use the &#8220;<a href=\"https:\/\/github.com\/Azure\/data-api-builder\/discussions\">Discussion<\/a>&#8221; page available in the GitHub repo, to start a discussion, propose an idea or provide some feedback and keep it going.<\/p>\n<h2>What else?<\/h2>\n<p>Data API builder supports not only Azure SQL database and SQL Server but also all other Azure Databases like <a href=\"https:\/\/aka.ms\/dab-cosmos-db\">Cosmos DB<\/a>, <a href=\"https:\/\/aka.ms\/dab-postgresql\">PostgreSQL<\/a>, and <a href=\"https:\/\/aka.ms\/dab-mysql\">MySQL<\/a>. Look at what Data API builder can do for other databases and with Static Web Apps here:<\/p>\n<ul>\n<li><a href=\"https:\/\/aka.ms\/dabdocs\">Azure Data API builder documentation<\/a><\/li>\n<li><a href=\"https:\/\/aka.ms\/dab-samples\">Azure Data API builder samples<\/a><\/li>\n<li><a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/static-web-apps\/database-overview\">Azure Static Web Apps Database Connections<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>I am extremely happy and excited to announce the public preview of Data API builder for Azure SQL Databases. Data API builder is a new product that we are adding to the developer\u2019s toolset to help every developer to be more efficient and effective, by instantly and securely turning Azure SQL Databases into a modern [&hellip;]<\/p>\n","protected":false},"author":24720,"featured_media":1786,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[409,510,504,410],"class_list":["post-1783","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure-sql","tag-api","tag-azure-sql-database","tag-graphql","tag-rest"],"acf":[],"blog_post_summary":"<p>I am extremely happy and excited to announce the public preview of Data API builder for Azure SQL Databases. Data API builder is a new product that we are adding to the developer\u2019s toolset to help every developer to be more efficient and effective, by instantly and securely turning Azure SQL Databases into a modern [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/posts\/1783","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\/24720"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/comments?post=1783"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/posts\/1783\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/media\/1786"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/media?parent=1783"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/categories?post=1783"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sql\/wp-json\/wp\/v2\/tags?post=1783"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}