16

Is there a way to create a Azure Sql Database and then expose it as a rest API so you may call restful calls to CRUD tables with OData?

5
  • 3
    It would be good if exists some recent (2017) blog posting about how to Expose Azure SQL tables using OData, being consumed by Xamarin.Forms, WPF, or ASP.Net MVC Commented Jan 20, 2017 at 0:50
  • 2
    Skyvia Connect easily and with no coding exposes SQL Azure data via OData REST API. In addition, it does not require any drivers or client libraries and offers useful features such as built-in security layer and detailed logging. Commented Jan 31, 2017 at 15:23
  • 1
    It is unfortunate that links in Microsoft's odata service are dead. Likely meaning this service is no longer being offered. The only solution is to write custom http/https apis. Commented Feb 9, 2021 at 17:10
  • is this problem still unresolved? Commented Apr 6, 2021 at 5:43
  • This should be closed, if it is looking for a "How To" then there is extensive detail on how to setup OData in MS Docs, its pretty easy, but there is no difference between Azure Sql Db and any other database. Create a Web API project, add in your EF DbContext, then add your OData Service Implementation. There are 3rd party wizards but the code from first principals in minimal in ASP. Net Core. This is a good start: github.com/OData/… Commented Sep 2, 2021 at 15:49

1 Answer 1

3

You will have to break this down into two steps

  1. Create the Azure SQL DB

    Refer: https://learn.microsoft.com/en-us/azure/azure-sql/database/single-database-create-bicep-quickstart?view=azuresql&tabs=CLI

  2. Expose the SQL DB with OData

    Refer: https://learn.microsoft.com/en-us/odata/webapi-8/getting-started?tabs=net60%2Cvisual-studio-2022%2Cvisual-studio

You can automate it completely by combining these two into a Single Azure Bicep/ARM template which will create the DB, create an AppService plan to host the ASP.NET OData web app and deploy the code. You will also have to think about how you want to control user access.

Sign up to request clarification or add additional context in comments.

1 Comment

This is actually a good answer upvote here. Interestingly, Azure SQL Database seemed to have Odata hooks built in back around 2010 but Microsoft silently removed that functionality.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.