Azure 专用端点和专用 DNS 区域

问题描述 投票:0回答:2

Azure VM 应使用专用端点访问 Azure Cosmos DB。 VM 和 Cosmos DB 位于不同的 VNET 中。我在 VM 所在的 VNET 中部署了一个专用终结点。我还为该专用端点和虚拟网络链接创建了一个专用 DNS 区域。因此,当我从 VM 执行“nslookup”到 Cosmos DB 的公共 URL 时,它不会解析为私有 IP。

nslookup mycosmos.documents.azure.com
Server:127.0.0.53
Address:127.0.0.53#53

Non-authoritative answer:
mycosmos.documents.azure.comcanonical name = mycosmos.privatelink.documents.azure.com.
mycosmos.privatelink.documents.azure.comcanonical name = cdb-ms-prod-westeurope1-f679.cloudapp.net.
Name:cdb-ms-prod-westeurope1-fd89.cloudapp.net
Address: 13.29.16.48

但是如果我对从私有 DNS 区域获得的私有 URL 执行“nslookup”,它会解析为正确的 IP

nslookup mycosmos.myprivatedns.com
Server:127.0.0.53
Address:127.0.0.53#53

Non-authoritative answer:
Name:mycosmos.myprivatedns.com
Address: 10.236.49.157

如果我没记错的话,当我对公共 URL 进行 nslookup 时,它应该解析为私有 IP?

azure endpoint
2个回答
0
投票

私有链接url优先于ip地址,然后解析为私有ip地址。如果它不能跟随私有链接 url,它将解析为公共 ip,它仍然有效(并且在您没有禁用公共网络访问的情况下工作)。

如果您通过 Azure 门户创建专用端点,它会在创建专用链接端点和相关资源的过程中自动禁用网络访问。如果您使用其他方法进行部署,例如一个二头肌模板,你必须自己考虑并禁用网络访问作为部署的一部分。


0
投票

我试图在我的环境中重现相同的内容我得到了如下相同的错误:

enter image description here

在不同的 vnet 中创建虚拟机和 Azure Cosmos DB,并在 VM 所在的同一 vnet 中使用私有终结点,并为该私有终结点和虚拟网络链接创建私有 DNS 区域,如下所示:

***虚拟机和堡垒机***

enter image description here

带有专用终结点的 Azure Cosmos DB:

enter image description here

enter image description here

我同意@NotFound 确保禁用公共访问 Cosmos DB,如下所示:

enter image description here

当我检查专用端点时,成功获得如下结果:

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.