Azure Resource Friendly display names via Api

Pratik Kumar (z) 1 Reputation point
2022-05-30T21:41:57.417+00:00

How can I get friendly Display name (specially for SubscriptionName) via Azure Resource Query graph ? I am running it via API and getting the sys name.

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,418 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Swathi Dhanwada 18,806 Reputation points Microsoft Employee
    2022-05-31T08:09:55.567+00:00

    @Pratik Kumar (z) Welcome to Microsoft Q & A Community Forum. You can use below query to retrieve the subscriptions names from management group.

    resourcecontainers  
    | where type == "microsoft.resources/subscriptions"  
    | project name  
    

    Or you can retrieve the list of resources along with the subscription name and resource type using below resource graph query.

    resources  
    | join kind=inner (  
        resourcecontainers  
        | where type == 'microsoft.resources/subscriptions'  
        | project subscriptionId, subscriptionName = name)  
        on subscriptionId  
    | extend rt = split(type,"/")  
    | extend resourcetype = rt[1]  
    | project subscriptionName, resourceGroup, name, resourcetype  
    

    Let me know if you are looking for something else. If the above queries has helped you, kindly "Accept As Answer" so that it would be beneficial for other community members who are looking for similar solution.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.