Calling DocumentDB (CosmosDB) Stored Procedure from Azure Logic App
In this blog post we will learn how to call DocumentDB Stored Procedure from Azure Logic App.
If you are not familiar with Azure DocumentDB (CosmosDB) please go through my previous article -
If you are not familiar with Azure DocumentDB (CosmosDB) please go through my previous article -
Working with Stored Procedure in Azure DocumentDB (CosmosDB)
URL: http://learntechalways.blogspot.in/2017/07/working-with-stored-procedure-in-azure.html
We will be using Stored Procedure created in my earlier post. If you have not created your Stored Procedure in Azure Cosmos DB, please follow the steps mentioned in blog-
Let's start creating Logic App-
Login to Azure Portal. Click on new in left panel. Search for Azure Logic App.
Click on "Logic App".
Click on "Create" button.
Provide details e.g.- Logic App name, Resource group & location. Click on "Create" button. Select Logic app & open designer in edit mode.
This will open different template to create logic app. Click on "When an HTTP request received" option.
This will open Logic App in designer mode with one Request action as below-
Click on "New Step" and "Add an action" option.
This will add option to add new action in logic app.
Search for "document" it will give you following options-
Click on "Azure DocumentDB - Execute stored procedure" option. If you are using DocumentDB in Logic App for first time, it will as you to save DocumentDB connection with name.
Provide connection name & select DocumentDB Account from list. Click on "Create" button. Now it will ask you to provide details of Stored Procedure.
Select Database ID, Collection ID, Stored Procedure ID and provide input parameters.
Add new "Response" action to give output of Stored Procedure to Logic App client.
Select Stored Procedure response Body in Response action Body field. Below will be the final Logic App.
Save Logic App. Click on Run option. Verify that we have received result of DocumentDB Stored Procedure in Logic App.
Body of Response action contains JSON received from DocumentDB Stored Procedure.
I hope you have understood using DocumentDB Stored Procedure in Logic App. If you have any query or question write to me at dharam.pal95@gmail.com.
Comments
Post a Comment