从 WIndows 更改为 Linux 应用服务计划后域名未解析
Domain Name is not being resolved after changing from WIndows to Linux App service Plan
之前我们有 Windows 应用服务计划,该计划中的应用服务启用了 VNet 集成以连接到本地服务。它曾经通过解析域名从应用服务访问本地服务。
最近,Microsoft 宣布 Linux 应用服务功能的区域 VNet 集成已普遍可用。我们尝试将所有 windows 应用程序服务迁移到 Linux。幸运的是,我们没有遇到任何子网委托问题。但迁移后,Linux 应用服务无法访问本地服务。它从 java 代码中说出 UnknownHostException,并从 Kudo 控制台尝试过,它还说域名没有被解析。我们注意到日志没有被推送到 Application Insights。
第二天,我们只是尝试使用 IP 地址而不是域名,它成功了。对于 Application Insights,我们无能为力。为了确认 Application Insights,我们断开了应用程序服务的 vnet 集成,然后该应用程序能够将日志发送到应用程序洞察力。
那会是什么问题呢?
您不能在已经托管 non-Linux Web 应用程序的应用程序服务计划中创建 Linux Web 应用程序。我想您已经为 Linux 创建了新的应用服务计划和应用服务来管理 regional VNet Integration。
Your app cannot resolve addresses in Azure DNS Private Zones without
configuration changes
The feature is fully supported for both Windows and Linux web apps.
All of the behaviors act the same between Windows apps and Linux apps.
从一个虚拟网络中的 App Service Web Apps 到不同虚拟网络中的 VM 的名称解析场景中,需要 customer-managed DNS 服务器在虚拟网络之间转发查询以供解析Azure(DNS 代理)。参见 Name resolution using your own DNS server.
默认情况下,应用服务使用 Azure 在委派的 VNet 中提供 DNS 服务器,它不知道您的 on-premise DNS 记录。您需要在 Azure 虚拟网络和目标网络中部署自定义 DNS 服务器以转发 DNS 查询。
对于 Application Insights,如果您已将应用设置 WEBSITE_VNET_ROUTE_ALL
设置为 1
,您可以检查是否有阻止对应用程序洞察的出站调用的规则。参考this.
If you integrate your app with your VNet, the default behavior remains
as it was. You would only be able to reach RFC1918 addresses
(10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16
) and service endpoints.
Just like with Windows, the feature now supports outbound calls into
the VNet on non-RFC1918 addresses as well. To reach all addresses you
need to set the app setting WEBSITE_VNET_ROUTE_ALL
to 1
, your app will
then enable all of the outbound traffic from your app to be subject to
NSGs and UDRs.
最后突然自己解决了。当我们询问 Microsoft 支持时,它提到他们最近在 backbone 网络中进行了网络更新。
由于我们不知道问题出在哪里,所以我们没有将 Win 迁移到更高环境中的 Linux,我们回滚到 Windows,之后就没有问题了。
之前我们有 Windows 应用服务计划,该计划中的应用服务启用了 VNet 集成以连接到本地服务。它曾经通过解析域名从应用服务访问本地服务。
最近,Microsoft 宣布 Linux 应用服务功能的区域 VNet 集成已普遍可用。我们尝试将所有 windows 应用程序服务迁移到 Linux。幸运的是,我们没有遇到任何子网委托问题。但迁移后,Linux 应用服务无法访问本地服务。它从 java 代码中说出 UnknownHostException,并从 Kudo 控制台尝试过,它还说域名没有被解析。我们注意到日志没有被推送到 Application Insights。
第二天,我们只是尝试使用 IP 地址而不是域名,它成功了。对于 Application Insights,我们无能为力。为了确认 Application Insights,我们断开了应用程序服务的 vnet 集成,然后该应用程序能够将日志发送到应用程序洞察力。
那会是什么问题呢?
您不能在已经托管 non-Linux Web 应用程序的应用程序服务计划中创建 Linux Web 应用程序。我想您已经为 Linux 创建了新的应用服务计划和应用服务来管理 regional VNet Integration。
Your app cannot resolve addresses in Azure DNS Private Zones without configuration changes
The feature is fully supported for both Windows and Linux web apps. All of the behaviors act the same between Windows apps and Linux apps.
从一个虚拟网络中的 App Service Web Apps 到不同虚拟网络中的 VM 的名称解析场景中,需要 customer-managed DNS 服务器在虚拟网络之间转发查询以供解析Azure(DNS 代理)。参见 Name resolution using your own DNS server.
默认情况下,应用服务使用 Azure 在委派的 VNet 中提供 DNS 服务器,它不知道您的 on-premise DNS 记录。您需要在 Azure 虚拟网络和目标网络中部署自定义 DNS 服务器以转发 DNS 查询。
对于 Application Insights,如果您已将应用设置 WEBSITE_VNET_ROUTE_ALL
设置为 1
,您可以检查是否有阻止对应用程序洞察的出站调用的规则。参考this.
If you integrate your app with your VNet, the default behavior remains as it was. You would only be able to reach RFC1918 addresses (
10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16
) and service endpoints. Just like with Windows, the feature now supports outbound calls into the VNet on non-RFC1918 addresses as well. To reach all addresses you need to set the app settingWEBSITE_VNET_ROUTE_ALL
to1
, your app will then enable all of the outbound traffic from your app to be subject to NSGs and UDRs.
最后突然自己解决了。当我们询问 Microsoft 支持时,它提到他们最近在 backbone 网络中进行了网络更新。
由于我们不知道问题出在哪里,所以我们没有将 Win 迁移到更高环境中的 Linux,我们回滚到 Windows,之后就没有问题了。