Manage logic apps with Visual Studio
Although you can create, edit, manage, and deploy logic apps in the Azure portal, you can also use Visual Studio when you want to add logic apps to source control, publish different versions, and create Azure Resource Manager templates for different deployment environments. With Visual Studio Cloud Explorer, you can find and manage your logic apps along with other Azure resources. For example, you can open, download, edit, run, view run history, disable, and enable logic apps that are already deployed in the Azure portal. If you're new to working with Azure Logic Apps in Visual Studio, learn how to create logic apps with Visual Studio.
Deploying or publishing a logic app from Visual Studio overwrites the version of that app in the Azure portal. So if you make changes in the Azure portal that you want to keep, make sure that you refresh the logic app in Visual Studio from the Azure portal before the next time you deploy or publish from Visual Studio.
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.
Access to the web while using the embedded Logic Apps 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.
Find your logic apps
In Visual Studio, you can find all the logic apps that are associated with your Azure subscription and are deployed in the Azure portal by using Cloud Explorer.
Open Visual Studio. On the View menu, select Cloud Explorer.
In Cloud Explorer, choose Account Management. Select the Azure subscription associated with your logic apps, then choose Apply. For example:
Based on whether you're searching by Resource Groups or Resource Types, follow these steps:
Resource Groups: Under your Azure subscription, Cloud Explorer shows all the resource groups that are associated with that subscription. Expand the resource group that contains your logic app, then select your logic app.
Resource Types: Under your Azure subscription, expand Logic Apps. After Cloud Explorer shows all the deployed logic apps that are associated with your subscription, select your logic app.
Open in Visual Studio
In Visual Studio, you can open logic apps previously created and deployed either directly through the Azure portal or as Azure Resource Manager projects with Visual Studio.
Open Cloud Explorer, and find your logic app.
On the logic app's shortcut menu, select Open with Logic App Editor.
This example shows logic apps by resource type, so your logic apps appear under the Logic Apps section.
After the logic app opens in Logic Apps Designer, at the bottom of the designer, you can choose Code View so that you can review the underlying logic app definition structure. If you want to create a deployment template for the logic app, learn how to download an Azure Resource Manager template for that logic app. Learn more about Resource Manager templates.
Download from Azure
In Visual Studio, open Cloud Explorer, then find and select the logic app that you want to download from Azure.
On that app's shortcut menu, select Open with Logic App Editor.
The Logic App Designer opens and shows the logic app. To review logic app's underlying definition and structure, at the bottom of the designer, choose Code View.
On the designer toolbar, choose Download.
When you're prompted for a location, browse to that location and save the Resource Manager template for the logic app definition in JSON (.json) file format.
Your logic app definition appears in the
subsection inside the Resource Manager template.
You can now edit the logic app definition
and Resource Manager template with Visual Studio.
You can also add the template as an Azure Resource
Manager project to a Visual Studio solution.
Learn about Resource Manager projects for logic apps in Visual Studio.
Refresh from Azure
If you edit your logic app in the Azure portal and want to keep those changes, make sure that you refresh that app's version in Visual Studio with those changes.
In Visual Studio, on the Logic App Designer toolbar, choose Refresh.
In Visual Studio Cloud Explorer, open your logic app's shortcut menu, and select Refresh.
Publish logic app updates
When you're ready to deploy your logic app updates from Visual Studio to Azure, on the Logic App Designer toolbar, choose Publish.
Manually run your logic app
You can manually trigger a logic app deployed in Azure from Visual Studio. On the Logic App Designer toolbar, choose Run Trigger.
Review run history
To check the status and diagnose problems with logic app runs, you can review the details, such as inputs and outputs, for those runs in Visual Studio.
In Cloud Explorer, open your logic app's shortcut menu, and select Open run history.
To view the details for a specific run, double-click a run. For example:
To sort the table by property, choose the column header for that property.
Expand the steps whose inputs and outputs you want to review. For example:
Disable or enable logic app
Without deleting your logic app, you can stop the trigger from firing the next time when the trigger condition is met. Disabling your logic app prevents the Logic Apps engine from creating and running future workflow instances for your logic app. In Cloud Explorer, open your logic app's shortcut menu, and select Disable.
When you disable a logic app, no new runs are instantiated. All in-progress and pending runs will continue until they finish, which might take time to complete.
When you're ready for your logic app to resume operation, you can reactivate your logic app. In Cloud Explorer, open your logic app's shortcut menu, and select Enable.
Delete your logic app
To delete your logic app from the Azure portal, in Cloud Explorer, open your logic app's shortcut menu, and select Delete.
When you delete a logic app, no new runs are instantiated. All in-progress and pending runs are canceled. If you have thousands of runs, cancellation might take significant time to complete.
When you open your logic app project in the Logic Apps Designer, you might not get the option for selecting your Azure subscription. Instead, your logic app opens with an Azure subscription that's not the one you want to use. This behavior happens because after you open a logic app's .json file, Visual Studio caches the first selected subscription for future use. To resolve this problem, try one of these steps:
- Rename the logic app's .json file. The subscription cache depends on the file name.
- To remove previously selected subscriptions for all logic apps in your solution, delete the hidden .vs folder in your solution's directory. This location stores your subscription information.
In this article, you learned how to manage deployed logic apps with Visual Studio. Next, learn about customizing logic app definitions for deployment:
We'd love to hear your thoughts. Choose the type you'd like to provide:
Our feedback system is built on GitHub Issues. Read more on our blog.