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




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.





1 Reply

Two options:


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

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"
| join (mysub) on SubscriptionId
| where SubscriptionId =="fakesubid-12345"
| project SubName, SubscriptionId