Share via

Call REST endpoints from Azure SQL database

sp_invoke_external_rest_endpoint is a system stored procedure that allows native invocation of an HTTPS REST endpoint from Azure SQL DB.

For full details on this stored procedure, please take a look at the official documentation here: sp_invoke_external_rest_endpoint (Transact-SQL)

Samples

Samples are made available via Jupyter Notebook, natively supported by GitHub and also by Azure Data Studio

Azure OpenAI

These samples and workshops show how you can call Azure OpenAI to get text embeddings and then find similar text using cosine similarity.

More on Azure SQL and AI can be found here.

Azure Functions

In the provided notebook you can find samples on how to invoke an Azure Function using a HTTP Trigger:

  • Invoke a public (or anonymous) Azure Function
  • Invoke an Azure Function protected by a secret key
  • Invoke an Azure Function protected by Azure AD

Azure Event Hubs

The notebook contains samples on how to send messages to Azure Event Hubs:

  • Send events using a SAS Token
  • Send events using a Managed Identity

Power BI

The notebook shows how DAX queries can be executed from Azure SQL DB using the executeQueries REST endpoint provided by Power BI datasets

  • Execute DAX queries in Power BI

Azure Cognitive Services

The notebook shows how to send data back and forth between an Azure Cognitive services, configured to perform Anomaly Detection.

[Azure SignalR]

Work in progress

[Azure Logic Apps]

Work in progress

Azure API Management

The notebook contains samples on how to invoke an HTTPS REST endpoint no matter if it is residing in Azure or in any other cloud or hosting platform, by securely publishing and API using Azure API Management

  • Call an external REST endpoint using API Management

Azure Blob Storage

This notebook has examples on working with Azure Blob Storage with SAS tokens and Managed Identities. Use the REST APIs for creating files, containers and then reading them back.

Contribute

Do you want to contribute adding a sample? Do you see something missing or incorrect? Please help this repository to grow, and submit an issue or fork it a submit a Pull Request. Details on how to contribute can be found here: Contributing