Deploy Azure Resource Manager templates for Azure Logic Apps

Applies to: Azure Logic Apps (Consumption)

After you create an Azure Resource Manager template for your Consumption logic app, you can deploy your template in these ways:

Deploy through Azure portal

To automatically deploy a logic app template to Azure, you can choose the following Deploy to Azure button, which signs you in to the Azure portal and prompts you for information about your logic app. You can then make any necessary changes to the logic app template or parameters.

Deploy to Azure

For example, you're prompted for the following information after you sign in to the Azure portal:

  • Azure subscription name
  • Resource group that you want to use
  • Logic app location
  • The name for your logic app
  • A test URI
  • Acceptance of the specified terms and conditions

For more information, see these topics:

Deploy with Visual Studio

To deploy a logic app template from an Azure Resource Group project that you created by using Visual Studio, follow these steps to manually deploy your logic app to Azure.

Deploy with Azure PowerShell

To deploy to a specific Azure resource group, use the following command:

New-AzResourceGroupDeployment -ResourceGroupName <Azure-resource-group-name> -TemplateUri https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.logic/logic-app-create/azuredeploy.json

For more information, see these topics:

Deploy with Azure CLI

To deploy to a specific Azure resource group, use the following command:

az deployment group create -g <Azure-resource-group-name> --template-uri https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.logic/logic-app-create/azuredeploy.json

For more information, see these topics:

Deploy with Azure DevOps

To deploy logic app templates and manage environments, teams commonly use a tool such as Azure Pipelines in Azure DevOps. Azure Pipelines provides an Azure Resource Group Deployment task that you can add to any build or release pipeline. For authorization to deploy and generate the release pipeline, you also need a Microsoft Entra service principal. Learn more about using service principals with Azure Pipelines.

For more information about continuous integration and continuous deployment (CI/CD) for Azure Resource Manager templates with Azure Pipelines, see these topics and samples:

Here are the general high-level steps for using Azure Pipelines:

  1. In Azure Pipelines, create an empty pipeline.

  2. Choose the resources you need for the pipeline, such as your logic app template and template parameters files, which you generate manually or as part of the build process.

  3. For your agent job, find and add the ARM Template deployment task.

  4. Configure with a service principal.

  5. Add references to your logic app template and template parameters files.

  6. Continue to build out steps in the release process for any other environment, automated test, or approvers as needed.

Authorize OAuth connections

After deployment, your logic app works end-to-end with valid parameters, but to generate valid access tokens for authenticating your credentials, you still have to authorize or use preauthorized OAuth connections. However, you only have to deploy and authenticate API connection resources once, meaning you don't have to include those connection resources in subsequent deployments unless you have to update the connection information. If you use a continuous integration and continuous deployment pipeline, you'd deploy only updated Logic Apps resources and don't have to reauthorize the connections every time.

Here are a few suggestions to handle authorizing connections:

  • Manually authorize OAuth connections by opening your logic app in Logic App Designer, either in the Azure portal or in Visual Studio. When you authorize your connection, a confirmation page might appear for you to allow access.

  • Preauthorize and share API connection resources across logic apps that are in the same region. API connections exist as Azure resources independently from logic apps. While logic apps have dependencies on API connection resources, API connection resources don't have dependencies on logic apps and remain after you delete the dependent logic apps. Also, logic apps can use API connections that exist in other resource groups. However, the Logic App Designer supports creating API connections only in the same resource group as your logic apps.

    Note

    If you're considering sharing API connections, make sure that your solution can handle potential throttling problems. Throttling happens at the connection level, so reusing the same connection across multiple logic apps might increase the potential for throttling problems.

  • Unless your scenario involves services and systems that require multi-factor authentication, you can use a PowerShell script to provide consent for each OAuth connection by running a continuous integration worker as a normal user account on a virtual machine that has active browser sessions with the authorizations and consent already provided. For example, you can repurpose the sample script provided by the LogicAppConnectionAuth project in the Logic Apps GitHub repo.

  • If you use a Microsoft Entra service principal instead to authorize connections, learn how to specify service principal parameters in your logic app template.

Next steps