Quickstart: Automate tasks and processes with Azure Logic Apps - Visual Studio
With Azure Logic Apps, you can create workflows that automate tasks and processes for integrating apps, data, systems, and services across enterprises and organizations. This quickstart shows how you can design and build these workflows by creating logic apps in Visual Studio and deploying those apps to Azure in the cloud. And although you can perform these tasks in the Azure portal, Visual Studio lets you add logic apps to source control, publish different versions, and create Azure Resource Manager templates for different deployment environments.
If you're new to Azure Logic Apps and just want the basic concepts, try the quickstart for creating a logic app in the Azure portal instead. The Logic App Designer in both the Azure portal and Visual Studio work similarly.
Here, you create the same logic app as in the Azure portal quickstart but with Visual Studio. This logic app monitors a website's RSS feed and sends email for each new item posted on the site. When you're done, your logic app looks like this high-level workflow:
Before you start, make sure that you have these items:
If you don't have an Azure subscription, sign up for a free Azure account.
Download and install these tools, if you don't have them already:
Visual Studio 2017 or Visual Studio 2015 - Community edition or greater. This quickstart uses Visual Studio Community 2017, which is free.
You can either download and install Azure Logic Apps Tools directly from the Visual Studio Marketplace, or learn how to install this extension from inside Visual Studio. Make sure that you restart Visual Studio after you finish installing.
An email account that's supported by Logic Apps, such as Office 365 Outlook, Outlook.com, or Gmail. For other providers, review the connectors list here. This logic app uses Office 365 Outlook. If you use a different provider, the overall steps are the same, but your UI might slightly differ.
Access to the web while using the embedded Logic App Designer
The designer requires an internet connection to create resources in Azure and to read the properties and data from connectors in your logic app. For example, if you use the Dynamics CRM Online connector, the designer checks your CRM instance for available default and custom properties.
Create Azure resource group project
Start Visual Studio and sign in with your Azure account.
On the File menu, select New > Project. (Keyboard: Ctrl+Shift+N)
Under Installed, select Visual C# or Visual Basic. Select Cloud > Azure Resource Group. Name your project, for example:
Select the Logic App template.
After Visual Studio creates your project, Solution Explorer opens and shows your solution.
In your solution, the LogicApp.json file not only stores the definition for your logic app but is also an Azure Resource Manager template that you can set up for deployment.
Create blank logic app
After you create your Azure Resource Group project, create and build your logic app starting from the Blank Logic App template.
In Solution Explorer, open the shortcut menu for the LogicApp.json file. Select Open With Logic App Designer. (Keyboard: Ctrl+L)
For Subscription, select the Azure subscription that you to use. For Resource Group, select Create New..., which creates a new Azure resource group.
Visual Studio needs your Azure subscription and a resource group for creating and deploying resources associated with your logic app and connections.
Setting Example value Description User profile list Contoso
By default, the account that you used to sign in Subscription Pay-As-You-Go
The name for your Azure subscription and associated account Resource Group MyLogicApp-RG
The Azure resource group and location for storing and deploying resources for your logic app Location MyLogicApp-RG2
A different location if you don't want to use the resource group location
The Logic Apps Designer opens and shows a page with an introduction video and commonly used triggers. Scroll past the video and triggers. Under Templates, select Blank Logic App.
Build logic app workflow
Next, add a trigger that fires when a new RSS feed item appears. Every logic app must start with a trigger, which fires when specific criteria is met. Each time the trigger fires, the Logic Apps engine creates a logic app instance that runs your workflow.
In Logic App Designer, enter "rss" in the search box. Select this trigger: RSS - When a feed item is published
The trigger now appears in the designer:
To finish building the logic app, follow the workflow steps in the Azure portal quickstart, then return to this article.
When you're done, your logic app looks like this example:
To save your logic app, save your Visual Studio solution. (Keyboard: Ctrl + S)
Now, before you can test your logic app, deploy your app to Azure.
Deploy logic app to Azure
Before you can run your logic app, deploy the app from Visual Studio to Azure, which just takes a few steps.
In Solution Explorer, on your project's shortcut menu, select Deploy > New.... If prompted, sign in with your Azure account.
For this deployment, keep the Azure subscription, resource group, and other default settings. When you're ready, choose Deploy.
If the Edit Parameters box appears, provide the resource name for the logic app to use at deployment, then save your settings, for example:
When deployment starts, your app's deployment status appears in the Visual Studio Output window. If the status doesn't appear, open the Show output from list, and select your Azure resource group.
After deployment finishes, your logic app is live in the Azure portal and checks the RSS feed based on your specified schedule (every minute). If the RSS feed has new items, your logic app sends an email for each new item. Otherwise, your logic app waits until the next interval before checking again.
For example, here are sample emails that this logic app sends. If you don't get any emails, check your junk email folder.
Technically, when the trigger checks the RSS feed and finds new items, the trigger fires, and the Logic Apps engine creates an instance of your logic app workflow that runs the actions in the workflow. If the trigger doesn't find new items, the trigger doesn't fire and "skips" instantiating the workflow.
Congratulations, you've now successfuly built and deployed your logic app with Visual Studio! To manage your logic app and review its run history, see Manage logic apps with Visual Studio.
Clean up resources
When no longer needed, delete the resource group that contains your logic app and related resources.
Sign in to the Azure portal with the same account used to create your logic app.
On the main Azure menu, choose Resource groups. Select the resource group for your logic app.
Choose Delete resource group. Enter the resource group name as confirmation, and choose Delete.
Delete the Visual Studio solution from your local computer.
- For questions, visit the Azure Logic Apps forum.
- To submit or vote on feature ideas, visit the Logic Apps user feedback site.
In this article, you built, deployed, and ran your logic app with Visual Studio. To learn more about managing and performing advanced deployment for logic apps with Visual Studio, see these articles: