Announcement!! APIM connector for Logic Apps Standard
Published May 08 2023 01:35 PM 4,765 Views
Microsoft

We are excited to announce the support for built-in APIM connector for Logic Apps Standard !!

 

This allows you to consume your APIs hosted in APIM from Logic Apps workflows. Through APIM connector, you get the same visual and low code experience as with any other connector, thus providing a very powerful way to extend the out of box connectors and consume your backend services and APIs.

 

By bringing the support of APIM connector in Logic Apps Standard, we now support connecting to your services and APIs hosted on-premises or in VNET. The APIM connector is a built-in connector, and therefore runs on the same compute as Logic Apps runtime and hence provides the performance benefits at no extra cost.

 

If you are using APIM for publicly hosted APIs or services, you should be able to use the connector like any other connector without any extra setup or configuration. However if you want to use APIM for services hosted in a VNET, extra setup is required. When a service is hosted in a VNET, there are certain pre-requisites particularly on how the network configuration is setup. We’ll cover those in the Pre-requisites below. If you already have a Logic App and your service configured in the VNET, you can skip the Prerequisites.

 

Pre-requisites

1. A web app or any other service – If you do not have one, you can follow this article and create a sample web-app. The example we are using in this article has been created from the sample web-app in this article.

 

DivSwa_0-1683329992476.png

 

2. The web-app should be deployed and enabled to run within a VNET. This article has information on how to connect your web-app to a VNET. Here is a screenshot of how the VNET settings appear for our sample app service. Note: You may enable Private endpoint but it’s not required.

 

DivSwa_1-1683330037566.png

 

3. To access your web application from Logic App, you need a Standard Logic App. If you do not have one, follow the steps here to Create a 'Standard' Logic App

 

4. The Logic Apps should be connected to the same VNET. Follow this article to configure VNET for your Standard Logic App. Your Logic Apps network settings should look something like this –

 

DivSwa_2-1683330086308.png

 

DivSwa_3-1683330145873.png

 

5.We recommended  to create a Virtual Machine in the same VNET to test the E2E scenario. From the VM, you can test if you can access your Web app as well as Logic Apps created in the above steps. One way to test is using nslookup command

 

APIM connector for accessing services/APIs in a VNET

There are 3 key steps involved to use APIM connector with Logic Apps for accessing APIs/services hosted in a VNET

 

1. VNET configuration for APIM

Since you want to call a web-app in the VNET, you’d need to host your APIM in the same VNET or link the VNETs through peering. This article covers VNET setup in detail. APIM offers two modes – Internal and External – if you want to invoke the APIs from VNET choose Internal mode. External mode can be used if your web app is hosted in VNET but your calling service, Logic App is publicly hosted.

 

Note: If you are setting up APIM in Internal mode, you’d be required to provide your own DNS resolution. This article covers it well.  Below are screenshots of Private DNS Zone for this sample

 

DivSwa_1-1683329527346.png

 

 

2. Import your web app into APIM

A web-app can be imported to APIM through multiple options. If you are familiar with creating custom connector, choose OpenAPI option to import your swagger based on OpenAPI definition.

 

DivSwa_2-1683329595570.png

 

Here is how the sample app I have used looks after importing is complete. You are now ready to call your service from Logic Apps using APIM connector.

 

DivSwa_3-1683329644627.png

 

After completing these two steps, you have your services imported into APIM and both are running in the VNET.

 

3. Invoke your service or APIs through built-in APIM connector

In your workflow, add new action and choose API Management operations connector. Select Call an Azure API Management API

 

DivSwa_3-1683328865807.png

 

You will be prompted to create the connection to your web service. After your select your service, based on the authentication mode, you may be prompted to add credentials.

 

DivSwa_0-1683329378424.png

After the connection creation, the APIM connector provides same experience as a custom connector. You can see all the APIs and choose the API as an action.

 

DivSwa_5-1683328993983.png

 

 

Testing the E2E scenario

To test the E2E scenario, you need to invoke the API from the same VNET. In below example, we are invoking it from a VM in the same VNET. The below screenshot shows a successful response in Postman after the API call.

 

DivSwa_1-1683328606597.png

 

For any questions or issues, please open an issue at Github and tag me (@divyaswarnkar) to it, and give a reference of this article.

 

 

 

 

 

Co-Authors
Version history
Last update:
‎May 08 2023 02:18 PM
Updated by: