【问题标题】:Disabling Datacenter Network Access to Cosmos DB Using Powershell / Azure CLI使用 Powershell/Azure CLI 禁用对 Cosmos DB 的数据中心网络访问
【发布时间】:2020-06-05 04:12:37
【问题描述】:

我浏览了文档以找到一种方法来禁用 “防火墙和虚拟网络” 设置页面上的选项“接受来自公共 Azure 数据中心内的连接” Powershell 或 Azure CLI,但我找不到。有人能做到吗?

【问题讨论】:

    标签: azure powershell azure-cosmosdb firewall azure-cli


    【解决方案1】:

    选中“接受来自公共 Azure 数据中心内的连接”选项时,会将值为 0.0.0.0 的条目设置为允许的 IP Rannges。这个0.0.0.0 IP 地址基本上告诉 Cosmos DB 接受来自公共 Azure 数据中心的连接。要阻止此访问,您只需从ipRangeFilter 中删除0.0.0.0 ip 地址。

    要获取属性,您将使用az cosmos show

    az cosmos show --name <cosmosdb-account-name> --resource-group <resource-group-name>`
    

    要更新 ip 范围,您将使用 az cosmos update

    az cosmosdb update  --name <cosmosdb-account-name> --resource-group <resource-group-name> --ip-range-filter "104.42.195.92,40.76.54.131,52.176.6.30,52.169.50.45,52.187.184.26"
    

    上述命令将阻止从公共 Azure 数据中心访问 cosmos db,但允许从 Azure 门户访问。

    Azure PowerShell 中的等效命令是 Get-AzCosmosDBAccountUpdate-AzCosmosDBAccount

    您可以在此处阅读更多信息:https://docs.microsoft.com/en-gb/azure/cosmos-db/how-to-configure-firewall

    【讨论】:

      猜你喜欢
      • 2019-07-20
      • 2022-11-10
      • 1970-01-01
      • 1970-01-01
      • 2022-07-22
      • 1970-01-01
      • 2020-10-23
      • 2020-12-14
      • 1970-01-01
      相关资源
      最近更新 更多