We usualy create Azure Logic Apps in Azure portal with all the drag and drop help. Still we can do it in Visual Studio Code which gives many benifits such as more control, testing, source controlling etc. Lets see how to achieve it step by step.
1) Preparation of Visual Studio Code environement
Before starting, make sure we have below Extensions installed in Visual Studio Code.
(Note: Visual Studio Code may take bit more time to validate and enable extensions. If your expected menu/ command is not available, may be you need to give bit of time.)
2) Create Logic App
Go to Workspace under azure and select Create new logic app workspace.
Its important to select below settings for this excersise. (Logic App type = Logic App (standerd) and Workflow Type = Stateful)
You may see below project is now created and folder structure as below.
Now Convert Logic App to NuGet based logic app project.
Now Open workflow.json file in designer.
Here you will need to select Use connecters from Azure option, Resource Group etc.
Now you are good to create a simple Logic App for testing purpose with familiar components. Here I have added below actions. Added sample json to Compose component and modified Response component to read output of Compose component.
This may also ask you to login to your Azure subscription.
3) Test locally
Now go to Run in editor and start Run / Debug.
Now try this url in Postman to see the result which is the sample json we passed.
4) Publish in Azure
If satisfied with testing, its time to deploy. Select Deploy to Logic app from the menu appear when right click the logicApp.
It will also ask few settings on Publishing in Azure and most of them are self-explanatory.
Once done, you will see newly deployed Logic App in Azure Portal.
5) Test Published App
Now, under workflow, you will see new workflow we designed with sample json, ready to be run.
Run will show us the json as the Response Body which is a proof our logic app is running successfully.(Ref: https://www.youtube.com/watch?v=ZOeTtgifIP4&t=306s)