Integrating Azure Logic Apps with On-Premises Systems

Connecting Azure Logic Apps with an onprem gateway

Introduction

Azure Logic Apps is a cloud-based service that enables you to automate workflows and integrate applications, data, and services across organisations. It provides a visual designer to build workflows that can connect to various cloud and on-premises systems. With Azure Logic Apps, you can create complex integrations with minimal code, making it an ideal solution for businesses looking to streamline their processes and improve efficiency.

Step-by-Step Implementation Guide

Prerequisites

Before you begin, ensure you have the following:

  • An Azure subscription
  • Bicep CLI installed
  • Visual Studio Code with Bicep extension
  • Basic understanding of Azure Logic Apps and on-premises data gateway

Using Bicep to Integrate with On-Premises Systems

Step 1: Define the Bicep File

Create a new Bicep file (e.g., logic-app-onprem.bicep) and define the parameters and resources needed for the Logic App, on-premises data gateway, and the integration workflow.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
param location string = resourceGroup().location
param logicAppName string = 'MyLogicApp'
param gatewayName string = 'MyOnPremisesDataGateway'
param connectionName string = 'MyOnPremisesConnection'

resource logicApp 'Microsoft.Logic/workflows@2019-05-01' = {
  name: logicAppName
  location: location
  properties: {
    definition: {
      "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
      "actions": {
        "Initialize_variable": {
          "type": "InitializeVariable",
          "inputs": {
            "variables": [
              {
                "name": "exampleVariable",
                "type": "string",
                "value": "Hello World"
              }
            ]
          },
          "runAfter": {}
        }
      },
      "triggers": {
        "Recurrence": {
          "type": "Recurrence",
          "recurrence": {
            "frequency": "Day",
            "interval": 1
          }
        }
      }
    },
    parameters: {}
  }
}

resource gateway 'Microsoft.Web/connections@2018-07-01' = {
  name: gatewayName
  location: location
  properties: {
    displayName: 'On-Premises Data Gateway'
    api: {
      id: '/subscriptions/{subscription-id}/providers/Microsoft.Web/locations/{location}/managedApis/onpremisesgateway'
    }
  }
}

resource connection 'Microsoft.Web/connections@2018-07-01' = {
  name: connectionName
  location: location
  properties: {
    displayName: 'On-Premises Connection'
    api: {
      id: '/subscriptions/{subscription-id}/providers/Microsoft.Web/locations/{location}/managedApis/onpremisesgateway'
    }
    parameterValues: {
      gateway: {
        id: resourceId('Microsoft.Web/connections', gatewayName)
      }
    }
  }
}

Step 2: Deploy the Bicep File

Use the Azure CLI to deploy the Bicep file to your Azure subscription.

1
az deployment group create --resource-group <Your-Resource-Group> --template-file logic-app-onprem.bicep

Step 3: Configure the On-Premises Data Gateway

After deployment, configure the on-premises data gateway by downloading and installing the gateway software on your on-premises server. Follow the instructions in the Azure portal to complete the setup and register the gateway.

Step 4: Create the Integration Workflow

In the Azure portal, navigate to your Logic App and use the visual designer to create the integration workflow. Add actions and triggers to connect to your on-premises systems using the configured connection.

Conclusion

Azure Logic Apps provides a powerful and flexible solution for integrating with on-premises systems. By using Bicep to define and deploy your Logic Apps and connections, you can ensure consistency, simplify management, and leverage DevOps practices for continuous integration and deployment. Azure Logic Apps enhances your ability to automate workflows and integrate systems seamlessly.

Learn More

For more detailed information and tutorials, visit the following Microsoft Learn resources: