azure - Is there a powershell command to add ipRules to CosmosDB in azure?
问题描述
I'm trying to add an ip to the network rules of CosmosDb (firewall) in azure, using powershell.
A lot of other resources seem to have a command available to do this (eg. keyvault Add-AzKeyVaultNetworkRule -VaultName myvault -IpAddressRange "10.0.1.0/24"
), but I can't find any for CosmosDb. Does anyone know if it actually exist? Thanks!
解决方案
$resourceGroupName = "myResourceGroup"
$accountName = "my-cosmos-account"
$ipFilter = @("10.0.0.0/8", "11.0.1.0/24")
$allowAzureAccess = $true
if ($true -eq $allowAzureAccess) {
$ipFilter += "0.0.0.0"
}
Update-AzCosmosDBAccount -ResourceGroupName $resourceGroupName `
-Name $accountName -IpRangeFilter $ipFilter
推荐阅读
- .net-core - 比较后删除EF核心中的子实体记录
- javascript - 从 mysql 中选择图像作为 blob 并在页面中显示后从磁盘中删除
- c# - WCF 返回 MemoryStream 返回空白和状态 202
- mule - Mule 3 TLS 推荐的密钥库类型是什么
- python - 上传数据到json
- html - nth-child(an+b):hover 不适用于 CSS 动画?
- java - 上传位于 jar 内的文件
- apache-flink - 无论如何数据集转换:“Distinct()”可以在 Flink 的数据流中使用吗?
- compilation - 如何在指针中处理 8051 XDATA 内存空间?
- php - 不同的行背景颜色取决于 MySQL 数据