Theability to call a REST endpoint natively from Azure SQL Database, which was made available via an Early Adopter Preview in May,is now moving to Public Preview. I’m extremely happy that as of today the new system stored proceduresp_invoke_external_rest_endpointis available to everyone, automatically and transparently: you can use it right away, from any Azure SQL Database that you may already have or that you’ll create in future.
Withsp_invoke_external_rest_endpointyou can call a REST endpoint, like an Azure Function, for example, with just a line of code:
Here’s a screenshot of the result of calling an Azure Function that provides information about local restaurants. The screenshot also shows that you can also query using GraphQL, if that is supported by the called endpoint.
Azure Function is just one of the services you can use withsp_invoke_external_rest_endpoint. In fact, you can callanyof the following Azure services:
Azure Apps Service
Azure App Service Environment
Azure Static Web Apps
Azure Logic Apps
Azure Container Instances
Azure Event Grid
Azure Event Hubs
PowerApps / Dataverse
Azure Cognitive Services
Aside from calling an Azure Function, as you can see, you really have a lot of options which will enable you to create more user-friendly and responsive solutions. Just a few ideas, for example:
integrate withAzure Event Hubs and Azure Event Gridis extremely easy now to push data out of Azure SQL to make it available to event-driven solutions.
integrate withPower BI so that you can execute a DAX query using theexecuteQueries REST endpoint and get the result right into Azure SQL DB
invoke any REST endpoint anywhere in the world, thanks to the integration withAPI Management
send a notification to aSignalRwebsite right from Azure SQL DB thanks to already mentioned Azure Function integration
enrich your data using AI and ML models – for example to detect anomalies – via the integration withAzure Cognitive Services
Enjoy and let us know if you like this feature and how you are using it,using the comment section below to give us your feedback and to tell us how you’d like to see this feature evolving,in the future. If you have some specific request, make sure to add it to theAzure SQL and SQL Server feedback portal, so that other users can contribute and help us prioritize future development. Looking forward to reading your ideas!