Azure / Azure/azure-cli

Add support for az cosmosdb network-rule add --ip-address

Open
#19,422 2 comments 2 reactions 0 assignees View on GitHub
act-codegen-extensibility-squad CosmosDB customer-reported feature-request Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

**Is your feature request related to a problem? Please describe.**
A lot of other Azure resources that have firewall support allow you to whitelist an IP in their firewall by issuing:
```
az ... network-rule add --ip-address
```
e.g

```
# KeyVault
az keyvault network-rule add --ip-address $Ip -g $ResourceGroup --name $KeyVaultName

# StorageAccount
az storage account network-rule add --ip-address $Ip -g $ResourceGroup --account-name $StorageAccountName

# ServiceBus
az servicebus namespace network-rule add --ip-address $Ip -g $ResourceGroup --namespace-name $Namespace

# EventHubs
az eventhubs namespace network-rule add --ip-address -g $ResourceGroup --namespace-name $Namespace
```

**Describe the solution you'd like**
Support for --action and --ip-address for the **az cosmosdb network-rule add** command.
```
IP Address Rule Arguments
--action : Action of the IP rule. Allowed values: Allow. Default: Allow.
--ip-address : IPv4 address or CIDR range - 10.6.0.0/24.
```
also **az cosmosdb network-rule list** should also include the firewall settings in its output just like all the other resources do.

**Describe alternatives you've considered**
Updating it via Azure Portal is not viable for automation and patching the config using "az cosmosdb update --ip-range-filter <ALL ALLOWED IP ADDRESSES>" is a bad option for adding a single IP.

**Additional context**
```
❯ az version
{
"azure-cli": "2.27.2",
"azure-cli-core": "2.27.2",
"azure-cli-telemetry": "1.0.6",
"extensions": {
"storage-preview": "0.7.2"
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.