Last active
May 11, 2022 17:17
-
-
Save aaronhoffman/cf5bd0c59216b3e6a57c0c6ea134cafb to your computer and use it in GitHub Desktop.
list all azure app insights resources and Instrumentation Keys powershell script Azure Az
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# more info https://aaron-hoffman.blogspot.com/2020/12/Find-Azure-Application-Insights-Resource-by-InstrumentationKey.html | |
# 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
blog post https://aaron-hoffman.blogspot.com/2020/12/Find-Azure-Application-Insights-Resource-by-InstrumentationKey.html