18 Create and Manage Logic apps from VSCode | Logic Apps with Visual studio code | logic apps

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone welcome to the channel where we are discussing logic app Integrations in detail so far in our previous videos we have discussed how do you create a different configurations within the logic app to Define your integration workflow in our previous demonstration we have defined the workflows from the Azure portal directly but what if we would like to create the workflow right there from the visual studio code or any ID tool so which ID tool we should be able to use to define the logic app workflow in the offline mode rather than connecting to the Azure portal and defining it right there from the portal itself so in today's demonstration I'll give you a walkthrough to create a logic app workflow from the visual studio code hi my name is Rakesh suryavanshi and you're watching BL honor okay to create the logic app from the visual studio code of course I need a visual studio instance and as we are defining the logic app in the offline mod I do not have any dependencies on my Azure portal or anything related to azure so first of all you open the logic app you open the folder or create a workspace in your Visual Studio code I have already opened a logic app dash vs code folder in this particular Visual Studio code instance as you can see that the folder is currently empty you can also create a workspace on that particular folder or you can convert a folder into a workspace and then work on that if you wish to that also supported in in order to create a workflow now there are a couple of things it needs to have on your system such as you need to have number of extensions needs to be installed for example your Visual Studio code should have extension or your workstation should have the extension to run the Azure function on your machine because the logic apps are usually works under the same Azure function integrated runtime to provide the offline working functionality Now to create a logic app workflow you need another in extension which is this one Azure extension so if you go to the extension search for the Azure I have number of the number of extension one of them is azure function extension as I mentioned and the other one is the Azure tool extension which I have installed here so once you install that you would find that this is the Azure extension currently I have not logged into any of my Azure subscription but without that I'm can simply create a project by clicking here on the top left button if you'd like to expand or create a new workflow you can create a new workflow onto existing project by clicking here if you would like to publish or deploy your logic app you can click here and deploy the workflow I would have a separate demonstration to show you how do you deploy the logic app right here from digital Studio code now apart from that we would like to export this particular logic app as a deployed package you can click here on this video button to export the package as we are here to create a new project and create a logic app from the visual studio code itself I'll click here the way on the very first button create project this will ask you to select the folder in which you would like to create this particular project So currently I'll select the same folder which we have open in this Visual Studio instance so I'll select this is the folder now next thing it it will ask you to select the workflow type which you would like to create in in this logic app project so there are two options stateless and stateful workflow so I am going to select the first option which is the stateful workflow because I want to create a stateful workflow next it will ask to provide the name of your stateful workflow I can give it any name so let's create a workflow or the demo workflow press enter and that is going to create a logica project in the three-step process as you can see from the bottom right section so it's creating a standard logic app I missed to tell you that this offline mode of the logic app is only possible to be created from Visual Studio code if you are creating a logica project which is of type standard so any consumption based logic app is not going to be available from the visual studio code because the workflow in the consumption based logic app will be part of your infrastructure as code and that will be deployed from the infrastructure logic of infrastructure part itself whereas in this case you can deploy or create a infrastructure as a separate and the workflow deployment can be a separate activity and that is that can be managed from the visual studio code so as you can see that we have quite a number of folders created so a very first folder is dot vs code folder which is the supported supporting folder individual Studio code which would provide a support to my logic app project which I have created will go into the detail of this particular folder in a while after that I have a artifact folder and in that artifact we have a map and schema in case if our logic app requires certain number of artifacts such as the xslt map or integration map or maybe a liquid map those map or schema I can Define here in this particular artifact folder next we have the workflow name which is the name of the workflow which we have given while creating the project so this is a workflow folder name which defines the name of your workflow and then you would have the Json which is a workflow Json which comes with the default schema definition after that we have certain number of function ignore file dot ignore file which has the list of uh ignored git ignore kind of a configuration which says that you need to ignore the dot debug dot gitstar.vs code and local setting and all those files basically next you have the host.json file basically to Define or to run your logic app as from the host configuration so anything you would like to configure in your logic app host that you can Define it here in the host.json for example if you would like to define or set the concurrency of your for each Loop or if you would like to set the concurrency or the configuration of your service message which which needs to be pulled in by the body wheel logic app project and you can Define all those configuration in the host.json file which unfortunately is not available directly from the Azure portal though you can Define and manage the host.json from the kudu console which will look into a separate video but if you are working on an offline project then you have full control to manage the host.json right here from this particular section next you have the local settings.json this is the same local settings.json which you will get it when you create Azure function project in Visual Studio code or vs code in this local settings.js and we have two settings at the moment which says that Azure web job storage setting which means that it is going to end and the value we have is use development storage true which means it is going to use the storage emulator which is running on my local machine to run the logic app as an emulator okay and next I have a function worker runtime and which is going to be at in this case it is type as a node type okay now what does it means that in order to run this logic app which runs under the Azure function uh space I need to have this storage emulator and I need to make sure that before I run or con before I start running this logic app on my local machine I need to have this storage emulator running on my machine which I'll come back to this later on okay now if I expand the visual studio code project you can see that we have certain number at the extensions dot Json which has the value of the Azure function string extension which we are using we have the launch Json file which has again a certain number of process ID which it is basically going to pick up for at the time of running this function then we have some certain settings it is the similar setting what we can find on the Azure portal for example what is your project runtime which is a version 4 what kind of language we are building it's by default language is given as a JavaScript and is this Azure function dot suppress project is it going to be true or false okay I do not have much of the detail about this but this is a default configurations you don't want to change this and after that we have number of tasks which are being configured with this particular project so again this is a default setting but if you have multiple logic of projects which you would like to run then what you can do is you can Define the number of tasks here and those with the help of those tasks you would be able to run the parallel Azure function instance or the one Azure function or one logic app instance in the same machine so that is what you can manage it from this particular class section now coming back to the workflow section which is which is what we are interested in to Define our workflow from our local machine so this is the workflow.json now if you would uh to design this workflow extension or to design this workflow from your Visual Studio code you need to install the logic app standard extension so this is the extension which I have it I have already installed so this is what you need to install to configure your workflows from the visual studio code now once you have this extension you can right click on the workflow you you will get number of options for example you will get option to overview uh to check the history of your logic app runs you can get an designer overview uh to open the designer of your workflow I'll click here on this particular designer and as you can see from the right top bottom right side it says it might take a moment to open the designer which is okay for the first time as we are opening it for the first time it will take a little bit time to open the workflow I'll wait for that so when you open the workflow it asks you two things uh which connector you would like to use do you want to use the connector from your Azure portal or you would like to use a or you would like to skip the connector for now so I'll choose the option skip for now now you can see that the workflow is open and the very first thing it has got is the choose an operation which means that I need to define a trigger which is a very first entry point for any logic of workflow so for this demonstration what we are going to do is we are going to define a simplest workflow trigger type which is a HTTP trigger type so I'll use the HTTP trigger connector and I have a trigger type in the HTTP request receive I'm not going to Define any schema so I'll keep the HTTP request for to receive for any schema for now next step I am going to use a compose operator or the compose connector which is a data operation part of it I use the connector for this and I'll say that whatever body parameter will reuse or receive from the HTTP receive part will basically take this as in compose operator you can use any connector what you can you will find it on the Azure portal almost all the connector will be available right here in this particular offline mode now what if there are connector which requires some kind of a connector to be configured for example a service bus connector had taken example let's say if I would like to pass the entire HTTP this body as in service message then what do I do to do that let's say if I select the service bus connector it will ask me to specify the connector so I'll say send a message to a queue before I do that obviously it's going to ask me to create a connector as this was a built-in type of connector so I need to specify the detail of the built-in connector so I'll give it a name of service bus connection which is this one authentication type I can choose the type as in connect connection string for this demonstration I'll open my service bus connect connection string I'll provide the value of the connection string here [Music] so that I can create a connector and the connection is created successfully I'll I need to provide the name of the queue so I'll use the name of the queue as in test which is the name of the queue which is the queue where I would like to post the message now to post a message what I'm going to do is I'm going to use the content option and then within the content let me see that I need to use the compose body operator okay so once that is done I need to respond back to this HTTP saying that okay I have done my job and everything is looking fine and I will say response status code is true and here I can say status equals to success [Music] it right save it so I am saving the workflow the workflow is saved locally all right so our logic app workflow is ready to test now and we have the HTTP trigger which is receiving the message and then it is posting this messages or the input request to the service bus now to before I run that as I mentioned this logic app workflow is running under the Azure function workspace so it means that the way we run the Azure function on our local environment or local world uh machine we need a storage emulator right uh to run the Azure function similarly to run the logic app on the visual studio code you need to have the little storage emulator and story emulator you can get it when you install the Azure SDK on on the visual studio code or Visual Studio but I do not have the storage emulator I might have installed that but the alternate option or the best option you have is to install one extension anyways the storage emulator is deprecated on Microsoft website so now if I go to the extension you can see that I have the extension called the Azurite and this is the extension which provides the storage emulation capabilities for the storage service bus queue topic so is the stable queue and block Service as you can see that as I've already installed on my status bar of the visual studio code I am getting these three services if I click here these three services will be started now I don't want to start those Services here in this particular instance because if I am going to start these Services by clicking here these will create number of folders and the files here on this Visual Studio project which will create unnecessary confusion and I might by mistakenly check in these files as well so what I usually do is I prefer to create or to create a separate dedicated folder like a run folder I have created here and here in this run folder I am running my Azure write by pressing the F1 you can type in as you write and call and start and that will start there as you write and simply if you would like to close it you can press close or type in close command and it will close as you write as well so as you can see that when I started the when I have started the Azure ride basically it has created number of files and now whenever I'm going to run any Azure function project or logic app project so all my logs uh which requires to go into the uh local storage emulator will be added to these block queues or table dot Json files I'll show you in a moment now I will go back to the I'll go back to the project here now of course this is a HTTP endpoint so I need to have the HTTP URL for to run this particular endpoint from the browser or from the postman to do that first of all I need to start the logic app I can press F5 or I can click here on the Run option and start running the debug option that will start the Run for my logic app so starting the tasks it's generating the uh debug symbol which it hasn't found I think there is some issue at my machine to load the debug symbol which is okay it has executed the function host start file similarly if I go to this debug option I can see that I the debug run option is attached to the node.net function type so if you have these shoes like me as you can see right right now the uh Azure function is not starting or my logic app is not starting or it's taking us so much of time to start then I have a trick for this which I can show you I don't know if that will work on your machine or not but let me just wait for this to completely start and then I'll show you now this has started but it has took it took quite a bit of time now let me show you what next I need to do to get the URL to get any URL you click here on the logic app overview section this is the URL but if I simply try and run this URL this will not work so ultimately what I need is I need this URL because this URL has invoke then API version and it also has some uh some kind of authentication token which is this token at the last appended this token so that it runs on my local machine without that if I run then it will fail so what I'll do is I'll click here on these URL which is this one and you can see that with this URL I'm going to choose a method type as a post and then I'm using this particular sample Json to post a message let me try and run for the very first time it might take a Time as you can see that the uh call has been succeeded and in our workflow we have mentioned that a state is equal to success so we've got that now if I validate the workflow whether it is succeeded or not I'll go to the workflow and here in the overview section you can see that we have a run which is which is in triggered and it has run for quite a long time which should not be the case when I run for the next time let me run that again and this time is just succeeded in six seconds which is Fair time now I can simply click here on this instance which has been triggered to view what happens to this run and here are the steps so HTTP trigger I got this particular message and I'm sending this message to this service bus and I can show you the message has been successfully posted we have run two times so we should have two messages here these are the two messages which we have in this particular size bus and that is proven that we are able to run the logic app right here from our machine right as I mentioned that if I delete all the restart or stop the Azure ride then I'll lose this uh tracing of my logic app so if you would like to keep monitoring or keep a history of this make sure that you do not lose the Azure write configuration or Azure log data which you have it on your zeroid configuration okay now one thing if you look at even though my terminal is running but I do not have any debug or in that point it could be the reason uh because of that uh debug issue which I was mentioning earlier so let me fix that I'll stop that I'll go to the debug and here what I have found is when I use this dotnet attaches in.net function at that point of time uh it has an issue for the very first time but if I switch back to let's say JavaScript and now if I try to run then hopefully it will work fine so let me try that if I stop debugging and then I'll run start again let's see if it loads the uh debug point just keep on asking me to sign into Azure which I don't want to do it right now as you can see that as I mentioned uh this time as it has successfully uh loaded my debug point or at least I know whether my workflow is working or not right here from this particular section let me test again and this is run in just a couple of milliseconds and message is posted again so we've got third message now okay so this has this is another trick which you can use with your Visual Studio code so as soon as I switch to the JavaScript debug terminal I can see I have the uh logs available and function is starting soon and I should be able to test that the way I was doing it earlier uh this is little bit weird I'm I'm getting uh pop-up again and again for signing it to azure but that's okay that's it in this demonstration you can do quite a lot of things with the visual studio code and logic app right here on your local station I'm also exploring so many other options uh but I just wanted to have a quick overview of using the visual studio code with the logic app uh with with you guys as and when I have some other updates related to the visual studio code I or I have some other findings I'll keep posting related to these changes or my uh or my understanding on these tools or the connectivity point of view I hope you have found this useful if it is please give it a thumbs up and do not forget to subscribe to the channel if you haven't already thanks for watching it see in the next video
Info
Channel: Our Cloud School
Views: 10,716
Rating: undefined out of 5
Keywords: Create and Manage Logic apps from VSCode, create logic from vscode, logic app, logic app in vscode, logicapp, logic apps, visual studio code, automation, business processes, workflows, APIs, environment setup, extensions, trigger, monitoring, debugging, version control, Git, Azure DevOps
Id: 7bThSU0F9vM
Channel Id: undefined
Length: 24min 2sec (1442 seconds)
Published: Sun Nov 20 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.