Create and deploy logic apps with Azure Resource Manager templates

Azure Logic Apps provides Azure Resource Manager templates that you can use, not only to create logic apps for automating workflows, but also to define the resources and parameters that are used for deployment. You can use this template for your own business scenarios or customize the template to meet your requirements. Learn more about the Resource Manager template for logic apps and Azure Resource Manager template structure and syntax.

Define the logic app

This example logic app definition runs once an hour, and pings the location specified in the testUri parameter. The template uses parameter values for the logic app name (logicAppName) and the location to ping for testing (testUri). Learn more about defining these parameters in your template. The template also sets the location for the logic app to the same location as the Azure resource group.

{
   "type": "Microsoft.Logic/workflows",
   "apiVersion": "2016-06-01",
   "name": "[parameters('logicAppName')]",
   "location": "[resourceGroup().location]",
   "tags": {
      "displayName": "LogicApp"
   },
   "properties": {
      "definition": {
         "$schema": "https://schema.management.azure.com/schemas/2016-06-01/Microsoft.Logic.json",
         "contentVersion": "1.0.0.0",
         "parameters": {
            "testURI": {
               "type": "string",
               "defaultValue": "[parameters('testUri')]"
            }
         },
         "triggers": {
            "Recurrence": {
               "type": "Recurrence",
               "recurrence": {
                  "frequency": "Hour",
                  "interval": 1
               }
            }
         },
         "actions": {
            "Http": {
              "type": "Http",
              "inputs": {
                  "method": "GET",
                  "uri": "@parameters('testUri')"
              },
              "runAfter": {}
           }
         },
         "outputs": {}
      },
      "parameters": {}
   }
}

Define parameters

With Azure Resource Manager, you can define parameters for the values to use when deploying the template. The template includes a parameters section that contains all the parameter values. Each parameter value is used by the template to define the resources that you want to deploy.

Note

Do not define parameters for values that always stay the same. Define parameters only for values that vary, based on the project that you are deploying or based on the environment where you are deploying.

When you define parameters:

  • To specify the permitted values that a user can provide during deployment, use the allowedValues field.

  • To assign default values to parameter when no values are provided during deployment, use the defaultValue field.

Here are descriptions for the parameters in the template:

Parameter Description JSON definition example
logicAppName Defines the name of the logic app that template creates. "logicAppName": { "type": "string", "metadata": { "description": "myExampleLogicAppName" } }
testUri Defines the location to ping for testing. "testUri": { "type": "string", "defaultValue": "http://azure.microsoft.com/status/feed/"}

Learn more about REST API for Logic Apps Workflow definition and properties and building on logic app definitions with JSON.

Deploy logic apps automatically

To create and automatically deploy a logic app to Azure, choose Deploy to Azure here:

Deploy to Azure

This action signs you in to the Azure portal where you can provide your logic app's details and make any changes to the template or parameters. For example, the Azure portal prompts you for these details:

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

Deploy logic apps with commands

To deploy the resources to Azure, you must be signed in to your Azure account and you must use the Azure Resource Manager module. To learn about using Azure Resource Manager with either Azure PowerShell or Azure CLI, see:

The following examples assume you already have a resource group in your account with the specified name.

PowerShell

New-AzureRmResourceGroupDeployment -TemplateUri https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-logic-app-create/azuredeploy.json -ResourceGroupName ExampleDeployGroup

Azure CLI

azure group deployment create --template-uri https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-logic-app-create/azuredeploy.json -g ExampleDeployGroup

Get support

Next steps