List the subscription for any azure resource(vm,aks,subnet.. etc) using az cli
See original GitHub issueI tried the az resource list --name <aks-cluster-name>. To get the details of the aks-cluster. but it returned empty.
Is there any other way to search for this? I want to find the subscription/subscriptionID and Resource-group for a particular aks-cluster-name. As pre-steps, I have just logged in to my Azure tenant, from which I can access all other subscriptions I get the below output.
[prupadhy01@myvm001 ~/aks_script]$ az resource list --name aks-cluster-name-01
[]
[prupadhy01@myvm001 ~/aks_script]$
I cannot depend on searching the subscriptionID or resource group from the portal first as I have 600 Subscriptions, with average 3 rg in them
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: e76a8ad2-efd8-9e8a-9b2b-eebeb1e9d1d4
- Version Independent ID: 280b7ea9-eb6c-9601-464b-09bf8e0cff5d
- Content: az resource
- Content Source: latest/docs-ref-autogen/resource.yml
- Service: azure-resource-manager
- GitHub Login: @rloutlaw
- Microsoft Alias: routlaw
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
az resource - Microsoft Learn
List all resources with the name 'resourceName'. Azure CLI Copy. Try It.
Read more >List all resources in a resource group using an Azure CLI ...
It's great to see all your resources list within the Azure portal and grouped within a resource group. In this video I show...
Read more >Can azure CLI get a list of all resources running in a tenant?
The code below will loop through all subscriptions and output all ... set --subscription $_.id $resourceList = az resource list --output ...
Read more >Azure CLI Basics: Listing Resources - Craig Forrester
As you can see from our previous command, Azure CLI outputs in JSON ... To list the resource groups for the selected subscription,...
Read more >Getting started with Azure CLI 2.0 - SQLShack
In order to view other subscriptions linked to your login, simply run the command “az account list“. This will show you a list...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@adthorn Currently, REST service does not support querying all resources under a tenant. If you have the requirements, please submit a new feature request and we will transfer it to the relevant service team
Hi @pradeep-upadhyay. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “
/unresolve
” to remove the “issue-addressed” label and continue the conversation.