Using Ethereum Logic Apps to monitor SQL server databases

Using Ethereum Logic Apps to monitor SQL server databases


Welcome to another episode of Block Talk. I’m Chris and today I’m going to walk you through a scenario of using our Logic App connectors are three M logical connectors and using those to Interact with a SQL server database now in previous episodes of Block Talk. We showed examples of how you Want to connect or how you could connect to a Postgres and a MySQL database using Logic App connectors And in those previous episodes we talked about the pattern where I have existing back-end systems That either need to be updated and keep track of contract information Or in this example today. We’re actually going to show how to use a back-end system MySQL server Sorry a SQL server database To create a contract and then when that contract is created we’re going to go ahead and close the loop and write some of that contract information right back into Our SQL database. So let’s go ahead and look at the Logic App flow To talk a little bit more about how that works So here you see I’m using a Logic App to monitor a SQL database now here. I’m just monitoring the table But anytime that table gets a row added that trigger triggers my ethereum Logic App connector to deploy a smart contract that smart contract is deployed using the information from the SWL l database so it’s using things like a Contract number sort of a reference number the Participants in the contract it’ll deploy that contract and when that contract information comes back once it’s deployed on the ledger I’m going to write the location of that contract. So the the Contract address. I’m going to write that back into the database so that my database has this running record Of what’s going on? And and where everything is on the ledger? Let’s take a look at the database real quick. Let’s see. What’s in there now So if I just run this simple query you see there’s nothing in my database So let’s go ahead and add something to my database. Let’s go ahead and add a number of things Let’s add into my table contract records Three pieces of information and now you can envision this comes from a back-end system something like an ERP and MRP dynamics some sort of system like that and I’m only gonna add three things to my to my Table, I’m gonna add a contract ID. Again. This is just a reference ID for the backend I’m gonna add the participants supply chain owner supply chain observer, and that’s it When I execute this query though, what’s going to happen in the background is? This process is going to kick off right this logic app will see that I’ve added a table This Logic App will deploy the address and then I’m going to go right back and update that table with my contract information Let’s go ahead and do that. Let’s hit run I’ve added this piece to the database. I’ve added these three pieces of information and in the background those logic apps are Doing their work now if I look now at If I go ahead and look at my database You see here. I added those first three pieces of information right contract ID supply chain owner a supply chain observer But now my logic gap has gone in the background and added Contract address this comes from the from the ledger this comes directly from the ledger So now I have the full circle I have from the beginning of a contract being added or a entry being added It’s a SQL contract being created and then the record of where that contract is being pushed right back into SQL So these back-end systems now have full visibility of what’s going on on my ledger And that was it. Thanks for joining me. Go ahead and subscribe or please follow us @MSFTblockchain On twitter. Thank you You

Danny Hutson

1 thought on “Using Ethereum Logic Apps to monitor SQL server databases

  1. Is Ethereum really monitoring (an instance of) Sql Server here? It seems like it's the opposite situation. Sql Server is monitoring what happens in Ethereum.

Leave a Reply

Your email address will not be published. Required fields are marked *