question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect output of the `az network vnet subnet list-available-ips` command

See original GitHub issue

I was checking the number of available ip addresses in the subnet where an application gateway is deployed using this:

schowdhu@schowdhu-mn1 ~ % az network vnet subnet list-available-ips --resource-group aag-rg --vnet-name aagVnet -n AAG1Subnet This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus [ "10.0.36.244", "10.0.36.245", "10.0.36.246", "10.0.36.247", "10.0.36.248" ]

Following shows my subnet size and the app gw instances deployed.

[schowdhu@schowdhu-ld3 ~]$ az network vnet subnet show -g aag-rg -n AAG1Subnet --vnet-name aagVnet | jq '.addressPrefix' "10.0.36.240/28"

[schowdhu@schowdhu-ld3 ~]$ az network application-gateway list -g aag-rg | jq '.[] | .name,.sku,.operationalState' "aag01" { "capacity": 8, "name": "Standard_Medium", "tier": "Standard" } "Running"

Based on the app gw documentation (https://docs.microsoft.com/en-us/azure/application-gateway/configuration-infrastructure#size-of-the-subnet), app gw uses one private IP address per instance, plus another private IP address if a private front-end IP is configured. Azure also reserves five IP addresses in each subnet for internal use: the first four and the last IP addresses. Taking the above example for reference, total available ip addresses in the subnet 10.0.36.240/28 is 16. Azure uses 5 ip addresses and app gw has 8 instances. There should be only 3 ip addresses remaining. However, the az network vnet subnet list-available-ips command shown above shows 5 ip addresses available.

https://learn.microsoft.com/en-us/cli/azure/network/vnet/subnet?view=azure-cli-latest#az-network-vnet-subnet-list-available-ips – This is the example in the documentation. It mentions “List some available ips in the subnet.”. Does it mean it shows free ip addresses which are not used yet in the subnet or just it just display a few ip addresses belonging to the subnet irrespective of weather they are being used or not.

Am I missing something here or is there an issue with what the command is showing.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:19 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
subhasishdccommented, Sep 30, 2022

@navba-MSFT : I will get back next week on this.

0reactions
navba-MSFTcommented, Oct 10, 2022

@subhasishdc Thanks for your reply. I am adding the Service team to look into this ask and assist you further.

@aznetsuppgithub Could you please look into this ask and provide an update ? Thanks in advance.

Read more comments on GitHub >

github_iconTop Results From Across the Web

az network vnet subnet - Microsoft Learn
Commands. az network vnet subnet create. Create a subnet and associate an existing NSG and route table. az network vnet ...
Read more >
azure-cli 2.19.1 - PyPI
The following examples are showing using the --output table format, you can change your default using the $ az configure command. Tab Completion....
Read more >
Can't create azure virtual machine using the cli - Stack Overflow
The problem is that you have provided a wrong subnet ID, the correct ... az network vnet subnet show -g <rgName> -n <subnetName>...
Read more >
azure – cli - techhadoop - WordPress.com
“isPlatformReserved”: false }. ovidiu@Azure:~$ az network vnet list-available-ips -g oviResourceGroup -n MyVNet. This command is in preview ...
Read more >
Azure CLI Basics: Listing Resources - Craig Forrester
If you just want to see a list of commands covered in this post: az account list az group list az network vnet...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found