Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to expose Azure Sql Server database using OData

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?

like image 252
foluis Avatar asked Jan 18 '26 22:01

foluis


1 Answers

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.

like image 80
Shinva Avatar answered Jan 21 '26 13:01

Shinva



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!