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.
Table of Contents
How to find Resource id in Azure portal
Follow the below steps to view the resource id of a Virtual Machine in Azure Portal.
- Log in to the Azure Portal.
- Search for the Virtual Machines and click on the search result Virtual Machines.
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.
4. Click on the Properties link from the left navigation.
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.
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
- Log in to the Azure Portal.
- Navigate to the storage account for the one you wish to view the Resource Id.
- On the Overview tab, click on the JSON view link from the right side.
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 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 :
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 :
You may also like following the below articles
- How to assign a static Public IP to Azure VM
- Get Storage Accounts Azure PowerShell
- How to Upload and Download File From Azure Blob Storage Using C# and PowerShell
- The ‘Get-AzResourceGroup’ command was found in the module ‘Az.Resources’
- Azure PowerShell List Resource Groups
- The term ‘New-AzResourceGroup’ is not recognized as the name of a cmdlet
Well, in this article, we discussed simple steps to find Azure Resource Id in Azure Portal and using PowerShell.
I am Rajkishore, and I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machine, Logic Apps, PowerShell Commands, CLI Commands, Machine Learning, AI, Azure Cognitive Services, DevOps, etc. Not only that, I do have good real-time experience in designing and developing cloud-native data integrations on Azure or AWS, etc. I hope you will learn from these practical Azure tutorials. Read more.