PAWIT.PW

My dedicated space, focusing on Power Apps and other Power Platform stuff 😉

How to call on-premise HTTP endpoint from Power Automate

Prologue

In today’s connected world, automating processes with Power Automate has become a powerful tool for enhancing productivity. However, one common challenge is integrating on-premise systems that aren’t directly accessible from the internet. In this post, I’ll walk you through how to connect to an on-premise HTTP endpoint securely, so you can bridge the gap between your local environment and the cloud seamlessly.


Problem

Many companies still rely on on-premise systems or virtual machines that host critical databases, API and internal services. For security reasons, these machines are often restricted from direct access over the internet and are only accessible within the local network. However, they typically have outbound access to the internet, allowing them to communicate externally under controlled conditions.

This setup becomes a challenge when you need to access these on-premise APIs from the internet, such as when using Power Automate. While Power Automate offers a robust ‘HTTP’ connector, it unfortunately only works with endpoints that are directly accessible from the internet.


Solution


How?

Before we dive in, let me walk you through my environment setup to ensure we’re all on the same page.

Virtual machine with HTTP endpoint

My environment

  • Virtual machine that connected the the internet but not accessible from the internet
  • MongoDB database
  • HTTP Endpoint that query data from MongoDB (using RESTHeart)

Alright, let’s dive into the step-by-step process of connecting to this local endpoint from the cloud!

Step 1 – Install Gateway

Once you see this, your gateway is ready to go.

Step 2 – Verify gateway

Step 3 – Create custom connector

Now, go to Custom connector tab and then select create custom connector

Step 4 – Config (General)

Now, you can config your connector. You may use your desired logo, name, description

Here is important part

  • Make sure that you checked ‘Connect via on-premises data gateway’
  • Scheme: Select the scheme that matches your endpoint (in this case, mine is HTTP). Don’t worry—your gateway will always use HTTPS to securely transmit your data to the cloud
  • Host: Enter your endpoint’s domain, IP address, and port (if applicable), localhost supported
  • Base URL: If you’re new to custom connector, just enter ‘/’

Step 5 – Config (Security)

Next, in the security section, you can choose how to authenticate to your endpoint. If your endpoint doesn’t require authentication, simply select ‘No authentication’.

In my case, the endpoint uses Basic Authentication, which requires a username and password.

Step 6 – Config (Definition)

This is the most complex part, Definition is just like: How many action your endpoint is supported and what your endpoint will return.

If you’re new and don’t know what to do; just follow this.

Create new action and give it some name.

Click ‘Add new‘ to add some sample request and paste your URL here (Just like in Postman)

Step 7 – Save & Test

Go to Test tab and then save your connector.

Once your connector has been saved, now you need to create a connection (just like when using standard connector)

If your connector require authentication (as per you config from Security tab) then enter your credentials.

Don’t forget to select the correct gateway!

Step 8 – Try it out!

Finally, it’s time to try your connector. You can create some flow and then add them to the flow.

Then try run the flow to test if it working. and boom!

At this point you may now understand about how your connector config reflect to your connector in action!


Leave a Reply

Your email address will not be published. Required fields are marked *