Connecting an Azure Logic App to a local Web API
Bryan Soltis demonstrates how you can test Logic Apps with your on-prem systems using a few cool tools and services.
When it comes to Logic Apps, Azure has a ton of connectors to allow you to design your automation workflows to integrate to all sorts of systems. Nearly every major Microsoft service is there, along with a slew of 3rd party components and services. And if those don’t fit the bill, you can develop your own connectors to do just about anything you need to.
A common step in Logic App integration is to develop a Web API to interact with other systems. The API usually handles the database connections, exposing methods for apps to consume. Developing that API locally almost always is the easiest path, especially when you’re working with internal database/systems. Add a Logic App into the mix, and now we have a challenge. How will our Logic App be able to access the local API? Unlike many other Azure services, Logic Apps aren’t assigned a static IP address. This means they can’t be let through a firewall/gateway, causing network admins to lose it when it comes to keeping them secure.
To get around this, we can easily 2 components to the mix, allowing us to connect our local Web API to the Logic App. These are the ngrok utility and an Azure API Management Service. ngrok allows us to create a secure, temporary tunnel to our local Web API, with a unique URL. APIM allows us to then use that URL for an endpoint for the Logic App to call, allowing us to call our methods. Because APIM’s can have static IPs, they can easily be whitelisted for any networks.
Check out the step-by-step example here.