DEV Community 👩‍💻👨‍💻

Cover image for Push the data out
Davide Mauri for Microsoft Azure

Posted on • Updated on

Push the data out

Event-Driven and reactive architectures (see the "Reactive Manifesto" if you're new to the topic or interested to learn more about it) are very popular today. Events - and thus data - is pushed to services so that integration can happen faster and more efficiently.

With Azure SQL database it is possible to call a REST API using the stored procedure sp_invoke_external_rest_endpoint. It is available in any Azure SQL Database (so, no Azure SQL Managed Instance or SQL Server for now) and it as easy to use as you would expect:

declare @response nvarchar(max);

exec sp_invoke_external_rest_endpoint 
    @url = N'https://say-hello.azurewebsites.net/api/hello-message',
    @response = @response output;

select * from openjson(@response);  
Enter fullscreen mode Exit fullscreen mode

Take a look at the documentation here: sp_invoke_external_rest_endpoint (Transact-SQL) and unleash your creativity. The possibilities that this feature opens are almost infinite.

The feature is in Public Preview, which means that this is the perfect time to give us your feedback, if you think something can be improved or needs to be changed. Feel free to comment here below, if you have any questions or ideas you want to share.

In the meantime, happy coding! :)

Top comments (0)

Super Useful CSS Resources

A collection of 70 hand-picked, web-based tools which are actually useful.
Each will generate pure CSS without the need for JS or any external libraries.