How to get Resource ID in Azure

How to find Resource id in Azure portal

Getting the Azure Resource ID is quite easy. This article will discuss the easiest ways to get resource ID in Azure. You can get the resource IDs of all the resources you created in Azure Portal. For example, a Virtual Machine, Storage Account, Logic Apps, Azure Function App, etc.

How to get Resource ID in Azure

Follow the below steps to view the Azure VM resource ID in the 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 find Resource id in Azure portal

3. Now, you can 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.

get resource id azure

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

Azure resource id example

How to get Resource ID in Azure using PowerShell

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

Get-AzResource -Name Resource Name | Format-List

For example, running the below Azure PowerShell cmdlet 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 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              : 
where to find resource id in azure portal

How to find resource ID of storage in Azure portal

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

Read the 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.
azure get resource id

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.

resource id in azure

In the same way, we can find the Resource ID of the 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 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              : 
resource id azure

You may also like following the articles below

Final Words

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