{"id":110886,"date":"2017-10-26T09:00:45","date_gmt":"2017-10-26T16:00:45","guid":{"rendered":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/on-premise-apis\/"},"modified":"2017-10-26T09:00:45","modified_gmt":"2017-10-26T16:00:45","slug":"on-premise-apis","status":"publish","type":"power-automate","link":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/on-premise-apis\/","title":{"rendered":"Connect to custom on-premises APIs using data gateway"},"content":{"rendered":"
At Ignite 2017, we announced the ability for Flow and PowerApps users to be able to use the on-premises data gateway to connect to APIs hosted within your internal network. This is a very exciting feature as it will allow you to extend the capabilities of the Flow and PowerApps to suit your very specific needs. In this blog post, I will show you how you can create a simple ASP.NET based REST API, host it on your local machine and connect to it via Flow and PowerApps.<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
http:\/\/localhost:1876\/api\/values\/<\/code>. If the request returns with a 200 OK response, you have successfully created and hosted a RESTful web API on your local machine.<\/li>\n<\/ul>\n<\/p>\n
\n- Next, we need to make sure that we can access the Web API using the local machine\u2019s IP address, which means that making a GET call to
http:\/\/{YOUR_IP_ADDRESS}:{YOUR_PORT_NUmber}\/api\/values\/<\/code> should return the same results. If you can\u2019t get this to work, make sure IIS is configured correctly to allow calling your API using your machines IP address. This blog post<\/a> goes in detail on how you can do just that, in case you are using IIS Express to host your API.<\/li>\n<\/ul>\nPart 2. Registering your on-premises Web API as a custom connector in Microsoft Flow or PowerApps<\/h2>\n
\nIf you aren\u2019t familiar with custom connector and required concepts, I highly recommend reading up<\/a> on it before proceeding further. The section assumes that you\u2019re familiar with custom connector concepts.<\/p>\n\n- Start by navigating to the Microsoft Flow or the PowerApps web portal and click on the Gear menu > Custom Connector. Click + New Custom Connector and select from Create from blank. Next, give a name to your connector.<\/li>\n<\/ul>\n
<\/p>\n
\n- Fill out the general section, of the custom connector. The most important piece here are the base URL and the host. Make sure you set it up to use your IP and Port. Ensure that you also select the correct scheme, for this instance we should be using HTTP, as we haven’t configured our API to use HTTPS.<\/li>\n<\/ul>\n
<\/p>\n
\n- As our API uses no authentication, we don\u2019t need to change anything on the Security Tab.<\/li>\n
- Under the definition tab, we will go ahead and define the Get Values operation by importing a sample request and response.<\/li>\n<\/ul>\n
<\/p>\n
\n- Once everything is imported and validated, go ahead and create the connector. The connector will take a few minutes to be operational.<\/li>\n<\/ul>\n
Part 3. Testing the Custom Connector via on-premises data gateway<\/strong><\/h2>\n\n- You will need to install an on-premise data gateway on a machine inside your network. You can download the latest version of the on-premises data gateway from here<\/a>. Once setup correctly, you should see a successful status on your local installation of the gateway.<\/li>\n<\/ul>\n
<\/p>\n
\n- After installing the gateway, create a connection for testing the connector. Make sure you choose the gateway we just installed to connect through to our on-premises web API.<\/li>\n<\/ul>\n
<\/p>\n
\n- Finally, test the custom connector by actually making a request though the test custom connector UI. If you see a 200 OK response come back, you have successfully managed to accomplish exactly what we had initially set out do.<\/li>\n<\/ul>\n
<\/p>\n
If you have any questions, suggestions or feedback about the on-premises custom connector capability, please feel free to post below in the comments, in our\u00a0community<\/a>, or reach out on Twitter.<\/p>\n","protected":false},"excerpt":{"rendered":"Learn how to extend workflows and business apps, by connecting to your on-premise RESTful APIs using the custom connector platform and on-premises data gateway.<\/p>\n","protected":false},"author":131,"featured_media":0,"comment_status":"open","ping_status":"open","template":"","power-automate-category":[2546,2752],"power-automate-tag":[],"coauthors":[2134],"class_list":["post-110886","power-automate","type-power-automate","status-publish","hentry","power-automate-category-developers","power-automate-category-product-updates"],"yoast_head":"\n
Connect to custom on-premises APIs using data gateway - Microsoft Power Platform Blog<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n\t\n