How to find Resource id in Azure portal

How to find Resource id in Azure portal

Getting the Azure Resource Id is quite easy. In this article, we will discuss the easiest ways to get resource id in Azure. You can get the resource ids of all the resources that you have created in Azure Portal. For example can be a Virtual Machine, Storage Account, Logic Apps, Azure Function App, etc.

How to find Resource id in Azure portal

Follow the below steps to view the resource id of a Virtual Machine in Azure Portal.

  1. Log in to the Azure Portal.
  2. Search for the Virtual Machines and click on the search result Virtual Machines.
how to get azure vm resource id

3. Now, you can able to see the list of the Azure Virtual machines, Click on the specific VM for the one you want to see the Resource Id.

How to get Azure Resource Id

4. Click on the Properties link from the left navigation.

How to get resource id of Azure Virtual Machine in Azure Portal

5. On the right side if you will scroll down a bit, you can able to see the Resource Id of your VM in Azure Portal.

Azure resource id example

How to find resource id of storage in Azure portal

If you want to get Resource Id of the storage account in Azure Portal, then you can follow the below steps.

Read article: How to get tenant id in Azure using PowerShell

  1. Log in to the Azure Portal.
  2. Navigate to the storage account for the one you wish to view the Resource Id.
  3. On the Overview tab, click on the JSON view link from the right side.
how to find resource id of storage account in azure portal

4. Now you can able to see the Resource ID of your storage account. Click on the Copy to clipboard button to copy the resource id.

how to find resource id of storage in azure portal

How to get Resource Id in Azure using PowerShell

You can also use PowerShell to get the Resource Id in Azure. You just need to use the below Azure PowerShell cmdlet.

Get-AzResource -Name Resource Name | Format-List

For example if you will run the below Azure PowerShell cmdlet, it will retrieve the Resource Id of a Virtual Machine.

Get-AzResource -Name TsInfoVM1 | Format-List

TsInfoVM1 is the name of the Virtual Machine.

Once I have executed the above Azure PowerShell cmdlet, you can see the output as below.

PS C:\WINDOWS\system32> Get-AzResource -Name TsInfoVM1 | Format-List


Name              : TsInfoVM1
ResourceGroupName : Demo123
ResourceType      : Microsoft.Compute/virtualMachines
Location          : eastus
ResourceId        : /subscriptions/1fgt4911-fgg9-4590-9v9v-fegg56a8tyh1/resourceGroups
                    /Demo123/providers/Microsoft.Compute/virtualMachines/TsInfoVM1
Tags              : 
How to get Resource Id in Azure using PowerShell

On the sameway, we can find the Resource Id of Storage account using PowerShell. Execute the below Azure PowerShell cmdlet.

Get-AzResource -Name democt34 | Format-List

Where democt34 is the name of the storage account.

Once I have executed the above Azure PowerShell cmdlet, I got the below output.

PS C:\WINDOWS\system32> Get-AzResource -Name democt34 | Format-List


Name              : democt34
ResourceGroupName : Demo123
ResourceType      : Microsoft.Storage/storageAccounts
Location          : eastus
ResourceId        : /subscriptions/1fgt4911-fgg9-4590-9v9v-fegg56a8tyh1/resourceGroups
                    /Demo123/providers/Microsoft.Storage/storageAccounts/democt34
Tags              : 
How to get Resource Id of storage using PowerShell

You may also like following the below articles

Final Words

Well, in this article, we discussed simple steps to find Azure Resource Id in Azure Portal and using PowerShell.