首页 > 解决方案 > 当 bot 托管在 microsoft azure 上时,我无法访问公司的数据库

问题描述

我为我的学士学位项目创建了一个 Microsoft 机器人,我正在与一家公司合作。微软机器人应该能够访问公司的数据库。我正在使用 Microsoft Azure 来托管机器人。从我的 Visual Studio 项目测试机器人时,一切正常(如果我连接到数据库所在的公司网络)。现在,当我将机器人部署到 microsoft bot 时,机器人无法访问数据库

我正在尝试使用 AdomdClient nuget 包访问数据库。我正在尝试连接到分析服务服务器。这就是我设置连接字符串的方式。数据源是公网IP,逗号后面是分析服务可用的端口。

AdomdConnection conn = new AdomdConnection("Data Source=xx.xxx.xx.xx,xxxxx;Catalog=someCatalog");

我的主管告诉我找出 microsoft bot 的托管位置(如果它是一个 azure 网站,因为他们将某些域列入了白名单,例如 azurewebsites.net)

机器人返回此错误,因为它没有找到任何资源。

Sorry, it looks like something went wrong.Could not find any resources appropriate for the specified culture or the neutral culture.  Make sure "Microsoft.AnalysisServices.AdomdClient.XmlaSR.resources" was correctly embedded or linked into assembly "AdomdClientNetCore" at compile time, or that all the satellite assemblies required are loadable and fully signed.```

标签: c#.netazurebotframeworkbots

解决方案


您无法从 Azure 连接到公司的本地数据库,除非它是可公开访问的,或者您的 Azure Web 应用程序使用通过 VPN(站点到站点)链接到您公司网络的 VNet,或者您正在使用 Azure Relay。


推荐阅读