Azure / Azure/azure-cli

Add privateIPAddressPrefixLength for az vmss command json output/input

Open
#32,553 2 comments 0 reactions 2 assignees Claimed by @zhoxing-ms View on GitHub
act-observability-squad Auto-Assign Azure CLI Team Compute feature-request
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

**Related command**

[az vmss update [--add]](https://learn.microsoft.com/en-us/cli/azure/vmss?view=azure-cli-latest#az-vmss-update)

**Is your feature request related to a problem? Please describe.**

Can we add support to create prefix IP address when adding secondary ip configuration using `az vmss update --add` command? Currently, the json output of the command doesn't include a property called privateIPAddressPrefixLength, so even when I added it, it'll be ignored and the created secondary ipconfig will just create a single IP instead of a prefix IP address range.

When running this command, it's supposed to create ipconfig with prefix address range instead of a single IP address
```
az vmss update --name test --resource-group $RG \
--add virtualMachineProfile.networkProfile.networkInterfaceConfigurations[0].ipConfigurations '{"name": "ipconfig2", "primary": false, "privateIpAddressPrefixLength": "28", "privateIpAddressVersion": "IPv4", "subnet": {"id": "'"$subnet_id"'", "resourceGroup": "'"$RG"'"}}'
```

**Describe the solution you'd like**

```
{
"applicationGatewayBackendAddressPools": null,
"applicationSecurityGroups": null,
"loadBalancerBackendAddressPools": null,
"loadBalancerInboundNatPools": null,
"name": "",
"primary": false,
"privateIpAddressVersion": "IPv4",
"privateIpAddressPrefixLength": "28", <- this line
"publicIpAddressConfiguration": null,
"subnet": {
"id": "",
"resourceGroup": ""
}
}
```

**Describe alternatives you've considered**

**Additional context**

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.