简体   繁体   English

从 azure 应用服务访问虚拟机上的服务

[英]Accessing service on a Virtual Machine from azure app service

We have got VMs on Azure and services are running in there.我们在 Azure 上安装了 VM,并且服务在其中运行。 We are trying to deploy our MVC Web application to Azure App service, which accesses some of the services from the VM using the private IPs but it can't connect to the service hosted on the VM using the private IP.我们正在尝试将我们的 MVC Web 应用程序部署到 Azure App 服务,该服务使用私有 IP 从 VM 访问某些服务,但它无法使用私有 IP 连接到托管在 VM 上的服务。 We were assuming that all of our resources will be in the same network, can anyone help with this?我们假设我们所有的资源都在同一个网络中,有人可以帮忙吗?

Thanks谢谢

Azure App service are having two kinds of hostings Azure App 服务有两种托管

  1. Single Tenant (App Service Environment) which is dedicated to the customer专为客户服务的单租户(应用服务环境)
  2. Multi tenant ( shareable across other customer subscription inside a data center scale unit)多租户(可在数据中心规模单元内的其他客户订阅之间共享)

If your application is hosted as multi tenant application meaning app service URL {WEbAppName}.Azurewebsites.net then its internet facing application and if it needs to connect to any VNET (Virtual Network) hosted service then it needs to integrate to any or same VNET.如果您的应用程序作为多租户应用程序托管,这意味着应用程序服务 URL {WEbAppName}.Azurewebsites.net 则其面向 Internet 的应用程序,如果它需要连接到任何 VNET(虚拟网络)托管服务,则它需要集成到任何或相同的 VNET .

How to do App service VNET Integration: https://docs.microsoft.com/en-us/azure/app-service/overview-vnet-integration#regional-virtual-network-integration如何进行应用服务 VNET 集成: https ://docs.microsoft.com/en-us/azure/app-service/overview-vnet-integration#regional-virtual-network-integration

Once the App service integrated with VNET then ideally it has connectivity with all the services present inside the same VNET or with peered VNET.应用服务与 VNET 集成后,理想情况下,它可以与同一 VNET 中的所有服务或对等 VNET 连接。

How to confirm connectivity from App Service to VNET hosted resource.如何确认从应用服务到 VNET 托管资源的连接。 Go to App Services application => Advanced tools or console => perform below commands sequence wise as the HTTP communication happens through this sequence:转到应用服务应用程序 => 高级工具或控制台 => 在 HTTP 通信通过此序列发生时按顺序执行以下命令:

  1. nslookup {Destination_FQDN} {Optional-DNSServer}/nameresolver {Destination_FQDN} {Optional-DNSServer} nslookup {Destination_FQDN} {Optional-DNSServer}/nameresolver {Destination_FQDN} {Optional-DNSServer}
  2. tcpping {Destination FQDN} tcpping {目标 FQDN}
  3. curl -v {DestinationFQDN} curl -v {DestinationFQDN}

Common Scenarios: If you're receiving connection refused it means its NSG is not allowing the communication.常见情况:如果您收到连接被拒绝,则表示其 NSG 不允许通信。 If you're getting request time out it means it could be due to firewall or no proper routes to reach to destination.如果您收到请求超时,则意味着可能是由于防火墙或没有正确的路由到达目的地。 If its connection abort it means its intermediate device is not passing connection through.如果它的连接中止,则意味着它的中间设备没有通过连接。

Troubleshoot connectivity issues using Azure Network Watcher: https://docs.microsoft.com/en-us/azure/network-watcher/network-watcher-connectivity-portal使用 Azure 网络观察程序解决连接问题: https : //docs.microsoft.com/en-us/azure/network-watcher/network-watcher-connectivity-portal

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure中虚拟机和应用服务之间的Vnet - Vnet between Virtual Machine and App Service in Azure 从 Azure 中的虚拟机连接到群集服务 - Connect to cluster service from virtual machine in Azure 如何在Azure中的特定虚拟机上创建应用程序服务? - How do i create app service on particular virtual machine in Azure? Azure虚拟机作为App Service环境中的辅助角色 - Azure Virtual Machine as Worker Roles inside an App Service Environment Windows Azure虚拟机和云服务Node.js应用程序部署 - Windows Azure Virtual Machine and cloud service nodejs app deploy 如何从部署在 Azure 应用服务中的 Web 应用使用在私有虚拟机中的 localhost:port 上运行的 Windows 服务? - How to consume a windows service running on localhost:port in a private virtual machine from a web app deployed in azure app service? Azure Web应用程序访问服务矩阵的虚拟网络 - Azure web app accessing service fabric's virtual network Azure DNS区域记录未解析到从App服务到虚拟机的指定IP - Azure DNS zone record not resolving to specified IP from App service to Virtual Machine 暂时将虚拟机从Azure云服务中删除以进行维护 - Temporarily drop virtual machine from Azure cloud service for maintenance 从Azure中国的虚拟机连接到MySql Service的问题 - Issue connecting to MySql Service from Virtual Machine in Azure China
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM