你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
在 Azure Spring Apps 中刷新 DNS 设置更改
注意
基本、标准和企业计划将从 2025 年 3 月中旬开始弃用,停用期为 3 年。 建议转换到 Azure 容器应用。 有关详细信息,请参阅 Azure Spring Apps 停用公告。
标准消耗和专用计划将于 2024 年 9 月 30 日开始弃用,并在六个月后完全关闭。 建议转换到 Azure 容器应用。 有关详细信息,请参阅将 Azure Spring Apps 标准消耗和专用计划迁移到 Azure 容器应用。
本文适用于:❎ 基本计划 ✅ 标准计划 ✅ 企业计划
注意
此功能仅适用于虚拟网络注入的 Azure Spring Apps 服务实例。
本文介绍如何在虚拟网络注入的 Azure Spring Apps 服务实例中更新 DNS 设置。
只有在所有基础节点中重启网络服务,对虚拟网络设置中的自定义 DNS 服务器的更改才会生效。 此重启是必需的,以便节点可以加载新设置。 以前,必须重启整个 Azure Spring Apps 实例,才能对 DNS 设置应用任何更改。 使用新的刷新 DNS 设置功能,可以避免这种耗时的操作。
刷新 DNS 设置不会重启服务实例中的任何基础节点或正在运行的应用程序,但它会重启网络基础结构以加载 DNS 设置更改。 此重启可能会中断网络服务,并对应用程序的可用性产生几秒钟的影响。
先决条件
Azure 订阅。 如果没有 Azure 订阅,请在开始之前创建一个 Azure 免费帐户。
(可选)Azure CLI 2.52.0 或更高版本。 使用以下命令删除以前的版本并安装最新扩展。 如果以前安装了 Spring Cloud 扩展,请先卸载它,然后再开始。
az extension remove --name spring az extension add --name spring az extension remove --name spring-cloud
部署到启用了虚拟网络注入的 Azure Spring Apps 的应用程序。
虚拟网络设置中配置的自定义 DNS 服务器。
刷新现有 Azure Spring Apps 实例的 DNS 设置
使用以下步骤刷新现有 Azure Spring Apps 实例的 DNS 设置:
登录到 Azure 门户。
在导航菜单中,选择“概述”。
选择“刷新 DNS 设置(预览版)”。
排查已知问题
以下列表介绍了连接到 DNS 服务器时可能会遇到的一些错误:
错误:
Failed to connect DNS server, connection timed out.
如果收到此错误,请检查网络路由规则或防火墙是否阻止流量从服务运行时或应用子网发往端口 53 上的自定义 DNS 服务器 IP 或自定义 DNS 服务器侦听端口。
错误:
Failed to resolve IP.
如果收到此错误,请检查上游 DNS 服务器是否已在 DNS 服务器中正确配置。 若要解决此问题,请在自定义 DNS 服务器中添加 Azure DNS IP
168.63.129.16
作为上游 DNS 服务器。 如果无法使用 Azure DNS 作为上游服务器,请使用其他有效的上游服务器来确保可以解析所有必需的域。 有关详细信息,请参阅在虚拟网络中运行 Azure Spring Apps 的客户责任。错误:
Not all the VM instances in the cluster are in succeeded running state.
此错误通常表示存在一些不正确的 DNS 或其他网络设置阻止基础节点预配。 若要缓解此问题,请修复网络设置并重启 Azure Spring Apps 服务实例。 有关详细信息,请参阅在虚拟网络中运行 Azure Spring Apps 的客户责任和对虚拟网络中的 Azure Spring Apps 进行故障排除。