[Storage] ip addresses with host bits set should be validated#31371
[Storage] ip addresses with host bits set should be validated#31371eric-therond wants to merge 1 commit intoAzure:devfrom
Conversation
|
Validation for Azure CLI Full Test Starting...
Thanks for your contribution! |
|
Validation for Breaking Change Starting...
Thanks for your contribution! |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
|
Thank you for your contribution @eric-therond! We will review the pull request and get back to you soon. |
|
Please add tests to this, I have tried creating 4.213.28.114/30 in portal and it was also not allowed. 4.213.28.112/30 is allowed. |
|
@calvinhzy look at this test case: 1/ Add x.x.x.x/x (IP address with host bits) by any means (in my case 4.213.28.114/30 was added via Terraform/API and not via the portal, sorry for the mistake). 2/ Now that the previous IP address has been added, try adding or removing any kind of IP (with or without host bits set) with the CLI tool, an error will occur, the storage network-rule configuration is no longer manageable via the CLI tool. |
|
Hi @eric-therond, usually CLI follows portal user behavior and it seems they only allow the starting ip address with the netmask so 4.213.28.112/30 is allowed. Adding @necusjz on network module behavior. |
afaik, we only support start ip. |

Related command
Description
It is possible through the azure portal to add ip addresses that have the host bits set but the az storage cli command doesn't accept that.
When an existing account storage has ip addresses with host bits set (added through the portal for instance) and then az storage account network-rule is used to add / remove ip addresses, the command will always fail, even if the ip addresses passed in parameter are valids and don't have host bit sets.
Here 4.213.28.114/30 is an existing ip address added through the portal.
Similar error in the past in another component:
#25031