Azure webjob 调用内部服务

Azure webjob calling internal service

我有一个调用 WCF 服务的控制台应用程序。此 WCF 服务位于 Azure 云服务 VM 上,并且 WCF 服务只能在内部访问(使用 Windows 凭据)。 Cloud Services VM 已添加到我们的域中。

我已将此控制台应用程序部署为 Azure 网络作业。它本身存在于 Azure App Services Web 应用程序中 - 没有相关的 Web 应用程序。

当我 运行 网络作业时,出现 "System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at..." 异常。这似乎是意料之中的,因为 Azure App Services Web App 不在域中或与内部 DNS 通信。

我的问题是,can/how 我可以将支持 Azure App Services Wep App 的 VM 添加到我们的域吗?如果没有,有什么选项可以让这个 webjob 与内部 DNS 对话?

通常,当尝试从 Azure 中连接 on-premise 资源或其他专用网络时,您可以查看几个选项:

选项 #1:应用服务环境:https://azure.microsoft.com/en-us/documentation/articles/app-service-app-service-environment-intro/

App Service Environments are isolated to running only a single customer's applications, and are always deployed into a virtual network. Customers have fine-grained control over both inbound and outbound application network traffic, and applications can establish high-speed secure connections over virtual networks to on-premises corporate resources.

由于虚拟网络,这将为您提供最大的灵活性,但由于它是高级产品,因此成本最高。

选项 #2:应用服务混合连接:https://azure.microsoft.com/en-us/documentation/articles/integration-hybrid-connection-overview/

Hybrid Connections are a feature of Azure BizTalk Services. Hybrid Connections provide an easy and convenient way to connect the Web Apps feature in Azure App Service (formerly Websites) and the Mobile Apps feature in Azure App Service (formerly Mobile Services) to on-premises resources behind your firewall.

我不太熟悉此选项,但它旨在与应用服务一起用于这些类型的场景。但是,如果您需要访问内部 DNS 或域控制器,则可能难以使用。

选项 #3:服务总线中继:https://azure.microsoft.com/en-us/documentation/articles/service-bus-dotnet-how-to-use-relay/

The Service Bus relay service enables you to build hybrid applications that run in both an Azure datacenter and your own on-premises enterprise environment. The Service Bus relay facilitates this by enabling you to securely expose Windows Communication Foundation (WCF) services that reside within a corporate enterprise network to the public cloud, without having to open a firewall connection, or require intrusive changes to a corporate network infrastructure.

此选项已存在一段时间,专为连接 WCF 服务而设计。它并非特定于 Azure 应用服务(正如您可能从文章中看出的那样),但它可能仍然很好,相当 light-weight 适合您的场景。但是,它也不会帮助您使用 DNS 和 on-premise 域控制器。