question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

List the subscription for any azure resource(vm,aks,subnet.. etc) using az cli

See original GitHub issue

I 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.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
zhoxing-mscommented, Jun 1, 2022

@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

0reactions
msftbot[bot]commented, Dec 22, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found