简体   繁体   中英

REST URI to get the ip address of a VM in azure

I need the rest URL to get the public ip address of a VM created in azure.

I am to list all the public URL's in my subscription from :

https://msdn.microsoft.com/en-us/library/azure/mt163635.aspx

I am also able to get all VM details.

https://docs.microsoft.com/en-us/rest/api/compute/virtualmachines?redirectedfrom=MSDN

But am not able to get the the associated ip for a particular VM!!

Any idea??

Thanks in advance

According to the link you mentioned above, it seems that you are using the Azure Resource Manager (ARM) VM.

But am not able to get the the associated ip for a particular VM!!

Different with Azure Service Management (ASM), the ARM VM doesn't bind the IP Address to the VM directly. In ARM, the VM is associated with NICs and each NIC can be associated with a public IP address.

So, in ARM mode, you need to find the NICs in the details of VM and then get the IP address associated with these NICs.

To get the detailed information of a specific public IP address, please use the following REST URL:

https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/{resoucegroup-name}/providers/Microsoft.Network/publicIPAddresses/{publicipaddress-name}?api-version={api-version}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM