forked from robotechredmond/Azure-PowerShell-Snippets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AzureRM - Get Azure Insights Metric Definitions.ps1
54 lines (42 loc) · 1.4 KB
/
AzureRM - Get Azure Insights Metric Definitions.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Sign-in to Azure via Azure Resource Manager
Login-AzureRmAccount
# Select Azure Subscription
$subscriptionId =
( Get-AzureRmSubscription |
Out-GridView `
-Title "Select an Azure Subscription ..." `
-PassThru
).SubscriptionId
Select-AzureRmSubscription `
-SubscriptionId $subscriptionId
# Select Azure Resource Group
$rgName =
( Get-AzureRmResourceGroup |
Out-GridView `
-Title "Select an Azure Resource Group ..." `
-PassThru
).ResourceGroupName
# Select Azure Resource
$resourceId =
( Get-AzureRmLoadBalancer -ResourceGroupName $rgName |
Select-Object Name, Id |
Out-GridView `
-Title "Select an Azure Load Balancer ..." `
-PassThru
).Id
$resourceId =
( Get-AzureRmNetworkSecurityGroup -ResourceGroupName $rgName |
Select-Object Name, Id |
Out-GridView `
-Title "Select an Azure NSG ..." `
-PassThru
).Id
$resourceId =
( Get-AzureRmVM -ResourceGroupName $rgName |
Select-Object Name, Id |
Out-GridView `
-Title "Select an Azure VM ..." `
-PassThru
).Id
# Get Metric Definitions for Resource
Get-MetricDefinitions -ResourceId $resourceId -DetailedOutput