Forum Discussion

Vino55's avatar
Vino55
Icon for Microsoft rankMicrosoft
Mar 11, 2019

Is it possible to fetch subscription name from LA Rest API?

Hi,

 

From our RP, we send resourceId along with other data to LA workspace through shoebox pipeline.

I notice that apart from the data RP sends, I see other extra metadata fields like tenant id, subscription Id.

Subscription name information is not available in AzureDiagnostics table.
However, when I checked the overview blade of LA workspace, I notice that subscription name is shown.

 

I am wondering if it is possible to fetch subscription name using LA RestAPI? If not LA, any other Azure resource Rest API would provide that? Any pointers would be helpful.

 

 

 

  • Two options:

     

    1. Some tables have this data, I know if I run 

    //AzureNetworkAnalytics_CL
    search "< insert name of your subscription here>"
    | summarize by $table

    I can see 

    AzureNetworkAnalytics_CL and ServiceDeck_CL have these records - if you have these you could join to that data?
     
     
    2. Could you put a datatable in your query to hold this info?
    let mysub = datatable (SubscriptionId:string, SubName:string)
    [
    "fakesubid-12344", "Demo workdpace1",
    "fakesubid-12345", "Demo workspace2"
    ];
    AzureDiagnostics
    | join (mysub) on SubscriptionId
    | where SubscriptionId =="fakesubid-12345"
    | project SubName, SubscriptionId
    
     

Resources