[英]How to connect to Azure Cosmos DB from Service Fabric Mesh
I'm trying to create an application that connects to a Cosmos DB and runs on Service Fabric Mesh. 我正在尝试创建一个连接到Cosmos DB并在Service Fabric Mesh上运行的应用程序。 I've created a simple console application that tries to make the connection 我创建了一个简单的控制台应用程序,尝试建立连接
var client = new Microsoft.Azure.Documents.Client.DocumentClient(new Uri(***), ***);
client.OpenAsync().Wait();
This causes an error "No such host is known" 这将导致错误“未知此类主机”
The CosmosDB URL is HTTPS, so I tried adding code to make HTTP and HTTPS calls to a website, which gave me a similar error. CosmosDB URL是HTTPS,因此我尝试添加代码以对网站进行HTTP和HTTPS调用,这给了我类似的错误。
Question Is there some config I need to allow my code external access to specific ports outside of the cluster? 问题是否需要一些配置才能允许我的代码从外部访问群集外部的特定端口?
I can create a connection to a SQL Server database. 我可以创建到SQL Server数据库的连接。
At the minute I'm just trying to debug the code locally. 目前,我只是想在本地调试代码。 I can connect if I run the code away from the cluster in a standalone console application. 如果我在独立控制台应用程序中将代码从群集中移开,则可以连接。
Thanks 谢谢
This is a known bug - open Dockerfile and add EXPOSE 80 to the first section, ie 这是一个已知的错误-打开Dockerfile并将EXPOSE 80添加到第一部分,即
FROM ... WORKDIR ... EXPOSE 80
then networking starts working. 然后网络开始工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.