Is there any way to execute the SQL query via Rest Endpoints in Azure Synapse Analystics

snehal dange 10 Reputation points

Our data is stored in the Blob storage and we are using Azure Synape Analytics to query the data.

This works fine with the Azure UI Interface.

We are trying to do this programmatically via REST APIs. Found this link which discuss on the REST support:, but could not find a REST / SDK support to execute these SQL queries.

I'm new to using Azure Synapse and azure service, so any advice you can provide is much appreciated.

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,405 questions
Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,316 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AnnuKumari-MSFT 30,361 Reputation points Microsoft Employee

    Hi snehal dange ,

    Welcome to Microsoft Q&A platform and thanks for posting your question here.

    As I understand your query here, you are trying to run SQL queries via REST API or via SDK using Azure synapse analytics. Please let me know if that is not the ask here.

    • You can store your SQL queries inside SQL scripts option in Develop tab and execute it directly in the Synapse workspace. Click here to know more about it.
    • REST APIs mentioned here are to fetch the content of the SQL scripts, to create and update those scripts etc. , not to execute the scripts. In order to execute those scripts, you can pass on the result obtained to 'Script activity' or run a stored procedure in Synapse pipeline. Check out this thread for more details on how to do the same.
    • You can use a serverless SQL pool to query data files in various common file formats, like CSV, JSON and parquet by using the following syntax:
    SELECT TOP 100 *
        BULK '*.csv',
        FORMAT = 'csv') AS rows

    For more details around the same , check this blog post: Query files using a serverless SQL pool

    Note: Synapse also supports Python and JAVA SDK .

    Hope it helps. Please do consider clicking Accept Answer and Up-Vote for the same as accepted answers help community as well

    1 person found this answer helpful.
    0 comments No comments