Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Azure Virtual Machine Unique ID


As many organisations are moving their workload to the Azure, It is important for an organisation to keep track of their Azure IaaS deployments. Azure provides support to identify each virtual machine with a unique identifier. This VM identifier can be used for licensing, reporting or general tracking purpose for Azure IaaS deployments. This unique identifier can’t be modified and can only be queried.

If you want to take advantage of this capability, you can access VM unique Identifier for Azure Virtual Machine using Azure Resource Explorer as follows.

Step 1 – Access and log in to the Azure Resource Explorer @ https://resources.azure.com

Step 2 – Navigate to your Windows or Linux Virtual machine.

Step 3 – Click on name of virtual machine and you will find all properties of the virtual machine on right side including VM unique identifier VmId.

Here is the PowerShell script to get virtual machine VmId.

$vm = Get-AzureRmVM -ResourceGroupName 'rg' -Name 'vm'
$vmResource = Get-AzureRmResource -ResourceName $vm.Name -ResourceGroupName $vm.ResourceGroupName -ResourceType 'Microsoft.Compute/virtualMachines'
$vmId = $vmResource.Properties.VmId
Write-Output $vmId

It is important to note that all the virtual machines which are created before September/2014 will get VmId upon restart.

Share the post

Azure Virtual Machine Unique ID

×

Subscribe to Msdn Blogs | Get The Latest Information, Insights, Announcements, And News From Microsoft Experts And Developers In The Msdn Blogs.

Get updates delivered right to your inbox!

Thank you for your subscription

×