无法访问Azure虚拟机上的自托管WCF服务

编程入门 行业动态 更新时间:2024-10-27 04:33:43
本文介绍了无法访问Azure虚拟机上的自托管WCF服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经在Azure虚拟机的基本地址new Uri("" + Environment.MachineName + ":1235/myService")上自托管了WCF服务.我已经打印了该地址,并以TRIALVM:1235/IRChatbotService的形式获取.我的虚拟机的DNS名称为trialvm.cloudapp.

I have self-hosted a WCF service on base adress new Uri("" + Environment.MachineName + ":1235/myService") on an Azure Virtual Machine. I have printed this address and I get it as TRIALVM:1235/IRChatbotService. The DNS name of my virtual machine is trialvm.cloudapp.

由于我已在端口1235上托管了此服务,因此我添加了具有以下属性的入站规则:

As I have hosted this service on port 1235, I have added the inbound rule with following properties:

仍然无法从外部VM访问创建的服务.当我转到同一虚拟机上的服务URL TRIALVM:1235/IRChatbotService,但不能从本地计算机访问服务页面时,我可以获得服务页面.

Still the created service is not accessible from outside VM. I am able to get service page when I go to the service URL TRIALVM:1235/IRChatbotService on the same virtual machine, but not from my local computer.

推荐答案

如果您使用的是 TRIALVM:1235/IRChatbotService 可以从无法使用的VM外部访问Web服务. TRAILVM是可在云服务中解析的主机名,但从外部世界来看,您需要云服务/负载平衡器的域名,在这种情况下,VM和云服务都称为trialvm,但是它们可以不同云服务中有许多虚拟机.在这种情况下,域名看起来是trialvm.cloudapp.

If you're using TRIALVM:1235/IRChatbotService to access the web service from outside the VM it won't work. TRAILVM is the hostname which is resolvable within the cloud service but from the outside world you need the domain name of the cloud service/load balancer, in this case both the VM and the cloud service are called trialvm but they can be different as you can have many vms in a cloud service. In this case the domain name looks to be trialvm.cloudapp.

Hth, 加雷斯(Gareth)

Hth, Gareth

更多推荐

无法访问Azure虚拟机上的自托管WCF服务

本文发布于:2023-11-01 22:54:02,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1550643.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:机上   无法访问   Azure   WCF

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!