Using custom connectors for Logic Apps in Azure is a way of connecting your logic app to different services. Azure already contains more than 200 connectors that can provide communication between your logic app and, for example, SAP, IBM 3270, Message Queue, and many more. But if you want to communicate with a service in which you need to provide a variety of different parameters, you can create a custom connector as well. In this guide, I’ll walk you through the basic steps of creating a custom connector.
Creating a Custom Connector for Logic Apps
When signing on to your Azure portal, the first thing I recommend is creating a new resource group (if you don’t already have one) in which you’ll place your logic app and custom connector. The list of Logic Apps, connectors, Azure functions, event grids, subscriptions, and so on will very quickly become confusing if you don’t use resource groups to sort these items.
Start by creating a new resource.
Search for the “Logic Apps Custom Connector”.
When you find and open it, click on the “Create” button.
Give the connector a name. In this case, I’m creating a custom connector to communicate with the Bizbrains Link receive site.
When the Logic Apps Custom Connector is created, the exciting part begins—the designer opens.
In this case, I’m going to communicate with an .svc service that also supports SOAP/WSDL; luckily, Azure also supports this type of service. By providing the URL for the WSDL and clicking on the “Import” button, Azure will analyze the service to see what classes and methods are available.
You can also provide a nice icon, description, and color.
All methods found will be listed in the “3. Definition” tab, where you can change the visibility of the method (e.g., none, advanced, internal, and important) if you don’t want particular methods to be available for the end user of the connector. In addition, you can provide a Summary and a Description for each of the methods to explain what they do.
After you click on the “Update connector” button (located in the upper-right corner), the connector will be adjusted and ready to use.
Assembling a logic app
Now you’re ready to start building your logic app to use the custom connector. Create or open an existing logic app. In my example, I’ve created a logic app that monitors a folder on sFTP to see if a new file arrives or is modified.
When adding a new action inside your logic app, simply select the “Custom” tab. Your custom connector will appear, and then you can select which action to execute in this step. Each of these actions corresponds to a web method inside your SOAP/REST/WSDL service.
When you choose the action to trigger, you’ll see a complete list of parameters that you can pass to the custom connector and through to the service. You can also add dynamic content, which is passed by the previous steps. As you can see in this screenshot, you need to pass the filename and the content of the file in two different parameters.
After you save the logic app, it’s ready for testing. Click on the “Run” button to start the app, and the trigger will begin looking for changes in the sFTP server folder. After a file is uploaded, the logic app will perform the necessary steps, which you can monitor to see if everything succeeded.
I hope this guide has given you enough information to get started on using custom connectors for Logic Apps. The next step is simply to go ahead and try it out for yourself.
Microsoft has provided an overview document describing custom connectors, so if you want know more, check out this page.