Deploying Logic Apps

post

Overview

The idea behind this post is to provide some useful tips and considerations for deploying Logic Apps

Parameters

One thing I find quite useful is to introduce parameters for any content that needs to be updated dynamically per environment, this means that if you are changing anything in the UI you can copy the actions block without worrying about overrwriting in parameter replacement.

Example

In the following template snippet, you can see that within the actions block the Logic Apps parameters are being used rather than directly using the ARM template parameters, this means we can copy the actions block directly from the ARM template export within Azure and not worry about having to change back the parameters block.

{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "microsoftTeamChannelId": {
      "type": "string"
    },
    "microsoftTeamId": {
      "type": "string"
    }
  },
  "resources": [
    {
      "type": "Microsoft.Logic/workflows",
      ...
      "properties": {
        "definition": {
          "parameters": {
            "teamChannelId": {
              "defaultValue": "",
              "type": "String"
            },
            "teamId": {
              "defaultValue": "",
              "type": "String"
            },
          },
          ...
          "actions": {
            "Business_Logic": {
              "actions": {
                "Post_to_Teams_Channel": {
                  "runAfter": {},
                  "type": "ApiConnectionWebhook",
                  "inputs": {
                    "body": {
                      "body": {
                        "messageBody": "Test Teams Message",
                        "recipient": {
                          "channelId": "@{parameters('teamChannelId')}"
                        }
                      },
                      "notificationUrl": "@{listCallbackUrl()}"
                    },
                    "host": {
                      "connection": {
                        "name": "@parameters('$connections')['teams']['connectionId']"
                      }
                    },
                    "path": "/flowbot/actions/flowcontinuation/recipienttypes/channel/$subscriptions",
                    "queries": {
                      "groupId": "@{parameters('teamId')}"
                    }
                  },
                  "runtimeConfiguration": {
                    "staticResult": {}
                  }
                }
              },
              "runAfter": {},
              "type": "Scope"
            }
          },
          "outputs": {}
        },
        "parameters": {
          ...
          "teamId": {
            "value": "[parameters('microsoftTeamId')]"
          },
          "teamChannelId": {
            "value": "[parameters('microsoftTeamChannelId')]"
          }
        }
      }
    }
  ]
}
Tim Hills

Tim Hills

Tim has been working in solution delivery for over 15 years and has really exceled in the industry. He has been fortunate enough to work with some high-profile clients and challenging projects which has positioned him well for turning business requirements into reality.

Registered office

Address: Arceau Solutions Ltd, Dane John Works, Gordon Rd, Canterbury, CT1 3PP

Telephone: 0208 191 7030