I have a SQL database server in Microsoft Azure. I want to use Azure Rest-API to select some records from a table. When I refer to Azure SQL Database REST API I can't find any section for this purpose, just I can get a DB information, server info or something like this. here is no suitable API to select or update a table. Could you please help me?
To run a SQL statement through REST, you POST a JSON document that includes the SQL statement to execute against the /api/servers/{alias}/databases/{dbname}/sql URI endpoint.
On your SQL database Overview page in the Azure portal, select Query editor (preview) from the left menu. On the sign-in screen, provide credentials to connect to the database. You can connect using SQL authentication or Azure AD.
As mentionned in the article, the Azure SQL Database REST API is designed for the management of the database and the server.
To query a SQL Database with REST queries, you can have a look at ODATA as explained on this post : How to expose Azure Sql Server database using OData.
I asked this question in Microsoft Azure Forum. The answer is like Rom Eh answer. You can see Microsoft team's answer in the following: You cannot make a query against your database hosted in Azure SQL Database using Azure Resource Manager REST API. The built-in REST API is supported for server and database management. This means you can only perform CRUD at server or database level (e.g. creating a new database, updating some settings). You can use OData as it is supported in Azure SQL Database query.
And related link: https://social.msdn.microsoft.com/Forums/azure/en-US/25d9baa4-2510-4ce4-b857-70a07e4ddea4/query-azure-sql-database-using-restapi?forum=azureapimgmt
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With