Implementing the outbox pattern with Azure SQL

Veli-Jussi Raitila 426 Reputation points
2022-12-04T18:47:50.267+00:00

I'm aware of mechanisms for implementing the outbox pattern with PostgreSQL with logical replication as well as with Cosmos DB by relying on change feeds. The latter is even documented by Microsoft here.

But what would be the proper method for achieving the same with Azure SQL?

Azure SQL Database
0 comments No comments
{count} votes

Accepted answer
  1. GeethaThatipatri-MSFT 29,502 Reputation points Microsoft Employee
    2022-12-14T15:19:20.75+00:00

    Hi, @Veli-Jussi Raitila Thanks for posting your question in the Microsoft Q&A forum.
    Excellent article from Davide Mauri here with code samples/examples:

    1. https://devblogs.microsoft.com/azure-sql/azure-sql-change-stream-with-debezium/
    2. https://learn.microsoft.com/en-us/samples/azure-samples/azure-sql-db-change-stream-debezium/azure-sql-db-change-stream-debezium/

    Please let me know if this helps.

    Regards
    Geetha


2 additional answers

Sort by: Most helpful
  1. Alberto Morillo 34,451 Reputation points MVP
    2022-12-04T22:49:26.967+00:00

    You can communicate with Azure Service Bus Queue through REST API and as you can read here you can now make REST API calls from a stored procedure on Azure SQL Database.

    In addition, on Azure SQL Managed Instance you can create a CLR (Common Language Runtime) Stored Procedure and call the Azure Service Bus through REST APi. See this video to know how to use CLR on Azure SQL Managed instance.


  2. Drew Skwiers-Koballa 1 Reputation point Microsoft Employee
    2022-12-21T23:05:44.76+00:00

    With Azure Functions you can utilize a SQL trigger - which monitors change tracking on the Azure SQL Database - to pass data changes to a component such as Azure Event Hubs or Service Bus.

    https://devblogs.microsoft.com/azure-sql/developing-with-azure-sql-bindings-and-azure-sql-trigger-for-azure-functions/


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.