通过PowerShell从公共Azure数据中心启用CosmosDb访问 [英] Enable CosmosDb access from public Azure datacenters through PowerShell
问题描述
在Azure门户中,我有一个选项,可以在为Cosmos DB配置防火墙时启用来自公共Azure数据中心的访问:
在VSTS中,我想使用PowerShell启用此选项,因为我们在那里运行了一个测试套件,该套件也进行了一些设置/拆卸,需要访问Cosmos DB.
用于Cosmos DB的PowerShell示例描述了如何添加IP限制,但没有介绍如何启用此特定选项.
这可能吗?
Robdeijn,
您可以使用Powershell设置IP限制和过滤,但不能使用Powershell直接修改允许来自"访问权限.配置.但是,您可能可以通过ARM模板进行设置.请查看以下文档: Azure Cosmos DB防火墙支持
此文档中有一部分:了解以下内容的结构和语法Azure资源管理器模板
如果您还有其他疑问,请告诉我.
此致
迈克
Hi,
In the Azure portal I have an option to enable access from public Azure datacenters when configuring the firewall for Cosmos DB:
In VSTS I want to enable this option using PowerShell since we run a test suite there that also does some setup / teardown that requires access to Cosmos DB.
The PowerShell samples for Cosmos DB describe how to add IP restrictions, but not how to enable this particular option.
Is this possible?
Hi Robdeijn,
You can use Powershell to set IP restrictions and filtering but you cannot use Powershell to directly modify the "Allow access from" configuration. You might, however, be able to set this via ARM Templates. Please take a look at the following documentation: Azure Cosmos DB firewall support
There is a section in this document: Using Azure Resource Manager Template to set up the IP access control
If you configure the desired functionality for this and then export the ARM template, in the exported Json file, you should see how this is enabled. Keep this, and use it to enable/disable features.
Understand the structure and syntax of Azure Resource Manager Templates
Please let me know if you have any additional questions.
Regards,
Mike
这篇关于通过PowerShell从公共Azure数据中心启用CosmosDb访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!