Edit and manage logic apps using Visual Studio - Azure Logic Apps (2024)

  • Article

Applies to: Azure Logic Apps (Consumption)

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 your logic apps to source control, publish different versions, and create Azure Resource Manager templates for various 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.

You can also manage your logic apps in the Azure portal.

Important

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 yourefresh the logic app in Visual Studio from the Azure portal before the next time you deploy or publish from Visual Studio.

Prerequisites

  • An Azure subscription. 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 2019, 2017, or 2015 - Community edition or greater. The Azure Logic Apps extension is currently unavailable for Visual Studio 2022. This quickstart uses Visual Studio Community 2017, which is free.

      Important

      When you install Visual Studio 2019 or 2017, make sure that you select the Azure development workload.For more information, see Manage resources associated with your Azure accounts in Visual Studio Cloud Explorer.

      To install Cloud Explorer for Visual Studio 2015, download Cloud Explorer from the Visual Studio Marketplace. For more information, see Manage resources associated with your Azure Accounts in Visual Studio Cloud Explorer (2015).

    • Azure SDK (2.9.1 or later)

    • Azure PowerShell

    • The latest Azure Logic Apps Tools for the Visual Studio extension for the version that you want:

      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.

    • To use Azure Government subscriptions with Visual Studio, see these topics for additional setup:

      • Visual Studio 2019: Quickstart: Connect to Azure Government with Visual Studio

      • Visual Studio 2017: Introducing the Azure Environment Selector Visual Studio extension, which you can download and install from the Visual Studio Marketplace.

  • 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.

Find 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.

  1. Open Visual Studio. On the View menu, select Cloud Explorer.

  2. In Cloud Explorer, select the Account Management icon. Select the Azure subscription associated with your logic apps, and select Apply. For example:

    Edit and manage logic apps using Visual Studio - Azure Logic Apps (1)

  3. Next to the Account Management icon, select Resource Types. Under your Azure subscription, expand Logic Apps so that you can view all the deployed logic apps that are associated with your subscription.

Next, open your logic app in the Logic App Editor.

Open logic apps 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 Group projects with Visual Studio.

  1. Open Cloud Explorer and find your logic app.

  2. From the logic app's shortcut menu, select Open with Logic App Editor.

    Tip

    If you don't have this command in Visual Studio 2019, check that you have the latest updates for Visual Studio.

    Edit and manage logic apps using Visual Studio - Azure Logic Apps (2)

    After the logic app opens in Logic Apps Designer, at the bottom of the designer, you can select 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

You can download logic apps from the Azure portal and save them as Azure Resource Manager templates. You can then locally edit the templates with Visual Studio and customize logic apps for different deployment environments. Downloading logic apps automatically parameterizes their definitions inside Resource Manager templates, which also use JavaScript Object Notation (JSON).

  1. In Visual Studio, using Cloud Explorer, open the logic app that you want to download from Azure.

  2. From the logic app's shortcut menu, select Open with Logic App Editor.

    Tip

    If you don't have this command in Visual Studio 2019, check that you have the latest updates for Visual Studio.

    The logic app opens in the Logic App Designer.

  3. On the designer toolbar, select Download.

    Edit and manage logic apps using Visual Studio - Azure Logic Apps (3)

  4. 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 resources 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 Group project to a Visual Studio solution. Learn about Azure Resource Group projects for logic apps in Visual Studio.

Link to integration account

To build logic apps for business-to-business (B2B) enterprise integration scenarios, you can link your logic app to a previously created integration account that exists in the same region as your logic app. An integration account contains B2B artifacts, such as trading partners, agreements, schemas, and maps, and lets your logic app use B2B connectors for XML validation and flat file encoding or decoding. Although you can create this link by using the Azure portal, you can also use Visual Studio after meeting the prerequisites, and your logic app exists as a JSON (.json) file inside an Azure Resource Group project. Learn about Azure Resource Group projects for logic apps in Visual Studio.

  1. In Visual Studio, open the Azure Resource Group project that contains your logic app.

  2. In Solution Explorer, open the <logic-app-name>.json file's shortcut menu, and select Open With Logic App Designer. (Keyboard: Ctrl + L)

    Edit and manage logic apps using Visual Studio - Azure Logic Apps (4)

    Tip

    If you don't have this command in Visual Studio 2019, check that you have the latest updates to Visual Studio and the Azure Logic Apps Tools extension.

  3. Make sure that the Logic App Designer has focus by selecting the designer's tab or surface so that the Properties window shows the Integration Account property for your logic app.

    Edit and manage logic apps using Visual Studio - Azure Logic Apps (5)

    Tip

    If the Properties window isn't already open, from the View menu, select Properties Window. (Keyboard: Press F4)

  4. Open the Integration Account property list, and select the integration account that you want to link to your logic app, for example:

    Edit and manage logic apps using Visual Studio - Azure Logic Apps (6)

  5. When you're done, remember to save your Visual Studio solution.

When you set the Integration Account property in Visual Studio and save your logic app as an Azure Resource Manager template, that template also includes a parameter declaration for the selected integration account. For more information about template parameters and logic apps, see Overview: Automate logic app deployment.

Change deployment location

In Visual Studio, if your logic app exists as a JSON (.json) file within an Azure Resource Group project that you use to automate deployment, that logic app is set to a location type and a specific location. This location is either an Azure region or an existing integration service environment (ISE).

To change your logic app's location type or location, you have to open your logic app's workflow definition (.json) file from Solution Explorer by using the Logic App Designer. You can't change these properties by using Cloud Explorer.

Important

Changing the location type from Region toIntegration Service Environmentaffects your logic app's pricing model that's used for billing,limits, integration account support, and so on.Before you select a different location type, make sure that you understand the resulting impact on your logic app.

  1. In Visual Studio, open the Azure Resource Group project that contains your logic app.

  2. In Solution Explorer, open the <logic-app-name>.json file's shortcut menu, and select Open With Logic App Designer. (Keyboard: Ctrl + L)

    Edit and manage logic apps using Visual Studio - Azure Logic Apps (7)

    Tip

    If you don't have this command in Visual Studio 2019, check that you have the latest updates to Visual Studio and the Azure Logic Apps Tools extension.

  3. Make sure that the Logic App Designer has focus by selecting the designer's tab or surface so that the Properties window shows the Choose Location Type and Location properties for your logic app. The project's location type is set to either Region or Integration Service Environment.

    Edit and manage logic apps using Visual Studio - Azure Logic Apps (8)

    Tip

    If the Properties window isn't already open, from the View menu, select Properties Window. (Keyboard: Press F4)

  4. To change the location type, open the Choose Location Type property list, and select the location type that you want.

    For example, if the location type is Integration Service Environment, you can select Region.

    Edit and manage logic apps using Visual Studio - Azure Logic Apps (9)

  5. To change the specific location, open the Location property list. Based on the location type, select the location that you want, for example:

    • Select a different Azure region:

      Edit and manage logic apps using Visual Studio - Azure Logic Apps (10)

    • Select a different ISE:

      Edit and manage logic apps using Visual Studio - Azure Logic Apps (11)

  6. When you're done, remember to save your Visual Studio solution.

When you change the location type or location in Visual Studio and save your logic app as an Azure Resource Manager template, that template also includes parameter declarations for that location type and location. For more information about template parameters and logic apps, see Overview: Automate logic app deployment.

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, select Refresh.

    -or-

  • In Visual Studio Cloud Explorer, open your logic app's shortcut menu, and select Refresh.

Edit and manage logic apps using Visual Studio - Azure Logic Apps (12)

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, select Publish.

Edit and manage logic apps using Visual Studio - Azure Logic Apps (13)

Manually run your logic app

You can manually trigger a logic app deployed in Azure from Visual Studio. On the Logic App Designer toolbar, select Run Trigger.

Edit and manage logic apps using Visual Studio - Azure Logic Apps (14)

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.

  1. In Cloud Explorer, open your logic app's shortcut menu, and select Open run history.

    Edit and manage logic apps using Visual Studio - Azure Logic Apps (15)

  2. To view the details for a specific run, double-click a run. For example:

    Edit and manage logic apps using Visual Studio - Azure Logic Apps (16)

    Tip

    To sort the table by property, select the column header for that property.

  3. Expand the steps whose inputs and outputs you want to review, for example:

    Edit and manage logic apps using Visual Studio - Azure Logic Apps (17)

Disable or enable logic apps

To stop the trigger from firing the next time when the trigger condition is met, disable your logic app. Disabling a logic app affects workflow instances in the following ways:

  • Azure Logic Apps continues all in-progress and pending runs until they finish. Based on the volume or backlog, this process might take time to complete.

  • Azure Logic Apps doesn't create or run new workflow instances.

  • The trigger won't fire the next time that its conditions are met.

  • The trigger state remembers the point at which the logic app was stopped. So, if you reactivate the logic app, the trigger fires for all the unprocessed items since the last run.

    To stop the trigger from firing on unprocessed items since the last run, clear the trigger's state before you reactivate the logic app:

    1. In the logic app, edit any part of the workflow's trigger.
    2. Save your changes. This step resets your trigger's current state.
    3. Reactivate your logic app.
  • When a workflow is disabled, you can still resubmit runs.

Disable logic apps

In Cloud Explorer, open your logic app's shortcut menu, and select Disable.

Edit and manage logic apps using Visual Studio - Azure Logic Apps (18)

Enable logic apps

In Cloud Explorer, open your logic app's shortcut menu, and select Enable.

Edit and manage logic apps using Visual Studio - Azure Logic Apps (19)

Delete logic apps

Deleting a logic app affects workflow instances in following ways:

  • Azure Logic Apps makes a best effort to cancel any in-progress and pending runs.

    Even with a large volume or backlog, most runs are canceled before they finish or start. However, the cancellation process might take time to complete. Meanwhile, some runs might get picked up for execution while the runtime works through the cancellation process.

  • Azure Logic Apps doesn't create or run new workflow instances.

  • If you delete a workflow and then recreate the same workflow, the recreated workflow won't have the same metadata as the deleted workflow. You have to resave any workflow that called the deleted workflow. That way, the caller gets the correct information for the recreated workflow. Otherwise, calls to the recreated workflow fail with an Unauthorized error. This behavior also applies to workflows that use artifacts in integration accounts and workflows that call Azure functions.

To delete your logic app from the Azure portal, in Cloud Explorer, open your logic app's shortcut menu, and select Delete.

Edit and manage logic apps using Visual Studio - Azure Logic Apps (20)

Troubleshooting

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 Visual Studio settings folder (.vs) in your solution's directory. This location stores your subscription information.

Next steps

In this article, you learned how to manage deployed logic apps with Visual Studio. Next, learn about customizing logic app definitions for deployment:

Author logic app definitions in JSON

Edit and manage logic apps using Visual Studio - Azure Logic Apps (2024)
Top Articles
Latest Posts
Article information

Author: Nathanial Hackett

Last Updated:

Views: 6262

Rating: 4.1 / 5 (72 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Nathanial Hackett

Birthday: 1997-10-09

Address: Apt. 935 264 Abshire Canyon, South Nerissachester, NM 01800

Phone: +9752624861224

Job: Forward Technology Assistant

Hobby: Listening to music, Shopping, Vacation, Baton twirling, Flower arranging, Blacksmithing, Do it yourself

Introduction: My name is Nathanial Hackett, I am a lovely, curious, smiling, lively, thoughtful, courageous, lively person who loves writing and wants to share my knowledge and understanding with you.