forked from erjosito/azcli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathservice-tags.azcli
18 lines (14 loc) · 895 Bytes
/
service-tags.azcli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#################################################
# Commands to look into defined service tags
# Two use cases:
# 1. Find the service tag for an IP
# 2. Look for the IPs in a set of service tags
#################################################
# Commands are restricted to a certain location
location=westeurope
# Find to wich service tag an IP belongs
# This is doing a basic contains, not too sophisticated
az network list-service-tags -l $location -o json | jq -r '.values[] | select(.properties.addressPrefixes[] | contains("13.92.84.128")) | .name'
# Find the IPs of a service tag
az network list-service-tags -l $location -o json | jq -r '.values[] | select(.name == "GatewayManager.EastUS") | [.name,.properties.addressPrefixes]'
az network list-service-tags -l $location -o json | jq -r '.values[] | select(.name | contains("GatewayManager")) | [.name,.properties.addressPrefixes]'