简体   繁体   中英

Remote connections inside Azure App Service

I am trying to open a connection inside my C# MVC.NET application, to retrieve some data and show them on a view. Everything works good when developing on localhost, using Visual Studio Community 2015 and its integrated IIS Express server.

When I deploy my application onto an Azure App Service, network connections stop working, I noticed my application becomes unable to reach outside network directly (ie I cannot use SSH.NET to give a command to a server or retrieve data). Application is still working (views are rendered/other controller actions execute perfectly) but when I request a network connection anywhere inside the app, failure happens.

Also, opening App Service console in Azure dashboard, I've noticed that I'm even unable to ping any host due to a missing IP driver.

What are the missing steps in my deployment or what am I misunderstanding?

If you are trying to connect to a VM or a on prem resource you need to set up Virtual Network to do this. As explained here . You can not directly make connection to resource directly outside the network.

I know I am late in the party but here is my two cent.

You should check that if the application pool user of your app service have access rights of the network/machine you are trying to connect because when you execute in the dev environment it works because I think the user on IIS would have rights to access the test network/machine.

PS To achieve the same you can create a parameterised console application and trigger it using a hosted simple API on the remote machine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM