Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
list all azure app insights resources and Instrumentation Keys powershell script Azure Az
# for each subscription in context
foreach ($subId in (Get-AzSubscription).Id | Get-Unique) {
write-host "Subscription $subId"
# set context to the given subId
Set-AzContext -SubscriptionId $subId
# List the name and InstrumentationKey of all Application Insights resources in this sub
Get-AzResource -ResourceType Microsoft.Insights/components -ExpandProperties | select -ExpandProperty Properties | select Name, InstrumentationKey | ft
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment