Azure SQL, Power Automate and JSON

Azure SQL, Power Automate and JSON

Good day, dear friends,

Importing JSON data to SQL can be tricky and cumbersome. There are numerous ways to do it. My new favourite is Power Automate.

In this example will use Power Automate Parse JSON connector and Azure SQL connection. It allows you great flexibility, along with a visual interface.

Let's say you have the following JSON you need to import to Azure SQL.  

{

   "book":[

      {

         "id":"444",

         "language":"C",

         "edition":"First",

         "author":"Dennis Ritchie "

      },

      {

         "id":"555",

         "language":"C++",

         "edition":"second",

         "author":" Bjarne Stroustrup "

      }

   ]

}  


First, let's create an Azure SQL database:

No alt text provided for this image

and call it books

No alt text provided for this image

Let's create a Power Automate. For simplicity's sake, it will be manually triggered flow. It will hold JSON string as a variable.

No alt text provided for this image

Now, we can use an amazing option to generate a schema from a sample. For we need to use data operation, "Parse JSON"

No alt text provided for this image

And Voila, in Power Automate Dynamics Content, you can see your JSON variable.

No alt text provided for this image
No alt text provided for this image


Save and Run your Flow.

No alt text provided for this image

Your data will be in Azure SQL.

Below is the image of the entire flow

No alt text provided for this image


Let me know if you have any questions and/or comments

Marc-André Lépine

Conseiller stratégique chez Microsoft pour le secteur de la santé publique du Québec.

4 å¹´

Part 2 should be using custum SQL queries with JSON parsing SQL actions. ;) 1 call, 1000 inserts.

要查看或添加评论,请登录

Igor Shvets的更多文章

社区洞察

其他会员也浏览了