cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ajennings1
Level: Powered On

Can't connect to 'localhost' Visual Studio API via Custom Connectors

I'm attempting to connect to a local WebAPI in VS 2017 to test that i can retrieve information in PowerApps using a custom connector.

My base host is formatted as: 'localhost:<port_no>'

I have set the base URL as simply '/'.

It all just seems that PowerApps is having a hard time locating the localhost. I have also tried connecting to the API with a simple MVC application and it's just a case of configuring a simple HTTPClient.

Does anybody know how i can connect to a localhost via PowerApps?

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
ajennings1
Level: Powered On

Re: Can't connect to 'localhost' Visual Studio API via Custom Connectors

@timl,

Ok sorry for all this confusion as it seems PowerApps to Azure SQL is secure enough directly. I think an API is only really necessary for MVC and other ASP apps.

Thanks.

View solution in original post

5 REPLIES 5
Highlighted
Super User
Super User

Re: Can't connect to 'localhost' Visual Studio API via Custom Connectors

Hi @ajennings1 

Just to confirm a few things, have you installed the on-premises gateway on your local machine (this is because URI that you specify in your custom connector works relative to where the on-premises is installed)? Do you have a Plan 1 or 2 license (or are within a valid trial period) to enable you to use custom connectors?

When you created your custom connector, did you check the option on the first page to use 'on-premises data gateway'?

Also, on your local machine, do you have any firewall/antivirus software installed? What we're looking for here is anything that could block the traffic between the gateway and your WebAPI.

 

ajennings1
Level: Powered On

Re: Can't connect to 'localhost' Visual Studio API via Custom Connectors

@timl,

I haven't installed an on-premise gateway. Would this be the cause of the issue?

Thanks.

Super User
Super User

Re: Can't connect to 'localhost' Visual Studio API via Custom Connectors

Hi @ajennings1 

Yes, because you're trying to connect to a web service that's running on your local machine, it's necessary to install the on-premises gateway. Without it, you can only connect to web services that are accessible via the public internet.

Just to clarify one of my previous points, here's the checkbox you'll need to check when you create your custom connector.

image.png

ajennings1
Level: Powered On

Re: Can't connect to 'localhost' Visual Studio API via Custom Connectors

@timl,

Sorry for the delayed reply but i tried creating an On-Premise Gateway but still had trouble connecting to my localhost port. Do you have any experience or have any examples of connecting to a localhost web api via Custom Connectors?

Thanks.

ajennings1
Level: Powered On

Re: Can't connect to 'localhost' Visual Studio API via Custom Connectors

@timl,

Ok sorry for all this confusion as it seems PowerApps to Azure SQL is secure enough directly. I think an API is only really necessary for MVC and other ASP apps.

Thanks.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 211 members 5,420 guests
Please welcome our newest community members: