Get data from Azure SQL using an API

aklive 46 Reputation points
2022-08-29T22:41:10.513+00:00

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 https://management.azure.com/subscriptions/{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 29,017 Reputation points Microsoft Employee
    2022-09-01T21:02:07.047+00:00

    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

    237075-image.png

    Please let me know if you need any additional information.

    Regards
    Geetha

    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
    2022-09-01T05:24:58.26+00:00

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

    236727-image.png

    Regards

    1 person found this answer helpful.

  2. Sérgio Terenas 1 Reputation point
    2023-01-12T21:44:34.18+00:00

    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.