Get data from Azure SQL using an API

aklive 46 Reputation points

Hello, how can I get the data from a sql table in azure via an API?

I have a view in azure sql table that I'd like to access using an API. I am using "GET{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}?api-version=2022-02-01-preview" which returns 200 Ok in postman but I do not see any data in the response.

How do I use the API outside of Postman to actually retrieve data?

Azure SQL Database
{count} votes

Accepted answer
  1. GeethaThatipatri-MSFT 27,012 Reputation points Microsoft Employee

    Hi, @aklive as I mentioned Microsoft.SQL APIs are control plane/management APIs. They are not returning any actual database content and schema.

    Microsoft.SQL has not onboarded any ARM data plane API framework. Based on my understanding, you could only retrieve database content and schema via T-SQL clients or Database Connectivity drivers (JDBC, ODBC, etc).

    Via the doc, this Database-tables API returns limited metadata as Database Tables - Get - REST API (Azure SQL Database) | Microsoft Learn


    Please let me know if you need any additional information.


    Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer.

2 additional answers

Sort by: Most helpful
  1. suchintya paul 6 Reputation points

    Hi @aklive , The SQL REST APIs just provide endpoints to manage SQL Resources. They are not meant for data manipulation.



    1 person found this answer helpful.

  2. Sérgio Terenas 1 Reputation point

    I’ve watched a Microsoft Mechanics video recently where they demoed a REST API to fetch data off an Azure SQL database. Believe it’s not GA yet but will be soon. I’m also after it! There’s not yet docs about it but you should find the video that shows it.