无法建立连接,因为目标计算机在连接​​到 Azure IP 时主动拒绝它

Jos*_*ard 4 .net c# azure

连接到 Azure 活动目录服务(请参阅下面的代码)时,我立即收到错误消息:

No connection could be made because the target machine actively refused it 191.235.135.139:443

谷歌搜索 IP 后,它解析为位于爱尔兰的 Azure 数据中心。虽然真正奇怪的是随着 IP 不时变化,昨天 191.235.195.38:443 的 Azure IP 工作没有任何问题?

public partial class Startup
{
    public void ConfigureAuth(IAppBuilder app, HttpConfiguration config)
    {
        app.UseWindowsAzureActiveDirectoryBearerAuthentication(
            new WindowsAzureActiveDirectoryBearerAuthenticationOptions
            {
                Audience = CloudConfigurationManager.GetSetting("AzureActiveDirectoryInstance"),
                Tenant = CloudConfigurationManager.GetSetting("Tenant"),
                Provider = new QueryStringOAuthBearerProvider("AUTHORIZATION")
            });

        app.UseWebApi(config);
    }
}
Run Code Online (Sandbox Code Playgroud)

我已经搜索了很多答案,尝试了一系列建议,例如检查没有使用端口 443(它告诉我目标机器主动拒绝连接的事实使我相信它能够到达机器)。

我认为这可能与 Azure 防火墙有关,但我有其他同事能够连接到同一公共 IP 地址上的服务。

有没有人在尝试连接到 Azure 服务时遇到过这种情况?

Jos*_*ard 5

在花了更多时间研究这个问题之后,看起来问题是因为我们的内部网络防火墙阻止了访问。