Skip to content

Commit be6d7f1

Browse files
authored
Merge pull request Azure#9466 from number213/service-tags
Improve Get-AzNetworkServiceTag's output formatting and update it's documentation
2 parents ebb30ed + 19bec98 commit be6d7f1

File tree

3 files changed

+169
-2
lines changed

3 files changed

+169
-2
lines changed

src/Network/Network/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
--->
2020
## Upcoming Release
21+
* Improve examples for `Get-AzNetworkServiceTag` reference documentation
2122

2223
## Version 1.10.0
2324
* Add support for Virtual Network Gateway Resource

src/Network/Network/Network.format.ps1xml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4232,5 +4232,44 @@
42324232
</ListEntries>
42334233
</ListControl>
42344234
</View>
4235+
<View>
4236+
<Name>Microsoft.Azure.Commands.Network.Models.PSNetworkServiceTagInformation</Name>
4237+
<ViewSelectedBy>
4238+
<TypeName>Microsoft.Azure.Commands.Network.Models.PSNetworkServiceTagInformation</TypeName>
4239+
</ViewSelectedBy>
4240+
<ListControl>
4241+
<ListEntries>
4242+
<ListEntry>
4243+
<ListItems>
4244+
<ListItem>
4245+
<Label>Name</Label>
4246+
<PropertyName>Name</PropertyName>
4247+
</ListItem>
4248+
<ListItem>
4249+
<Label>System Service</Label>
4250+
<ScriptBlock>$_.Properties.SystemService</ScriptBlock>
4251+
</ListItem>
4252+
<ListItem>
4253+
<Label>Region</Label>
4254+
<ScriptBlock>$_.Properties.Region</ScriptBlock>
4255+
<ItemSelectionCondition>
4256+
<ScriptBlock>
4257+
$_.Properties.Region -is [string] -and $_.Properties.Region.Length -gt 0
4258+
</ScriptBlock>
4259+
</ItemSelectionCondition>
4260+
</ListItem>
4261+
<ListItem>
4262+
<Label>Address Prefixes</Label>
4263+
<ScriptBlock>$_.Properties.AddressPrefixes</ScriptBlock>
4264+
</ListItem>
4265+
<ListItem>
4266+
<Label>Change Number</Label>
4267+
<ScriptBlock>$_.Properties.ChangeNumber</ScriptBlock>
4268+
</ListItem>
4269+
</ListItems>
4270+
</ListEntry>
4271+
</ListEntries>
4272+
</ListControl>
4273+
</View>
42354274
</ViewDefinitions>
42364275
</Configuration>

src/Network/Network/help/Get-AzNetworkServiceTag.md

Lines changed: 129 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,144 @@ The **Get-AzNetworkServiceTag** cmdlet gets the list of service tag information
2323

2424
### Example 1
2525
```powershell
26-
PS C:\> Get-AzNetworkServiceTag -Location eastus2
26+
PS C:\> $serviceTags = Get-AzNetworkServiceTag -Location eastus2
27+
PS C:\> $serviceTags
2728
2829
Name : Public
2930
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx/providers/Microsoft.Network/serviceTags/Public
3031
Type : Microsoft.Network/serviceTags
3132
ChangeNumber : 63
3233
Cloud : Public
3334
Values : {ApiManagement, ApiManagement.AustraliaCentral, ApiManagement.AustraliaCentral2, ApiManagement.AustraliaEast...}
35+
36+
PS C:\> $serviceTags.Values
37+
38+
Name : ApiManagement
39+
System Service : AzureApiManagement
40+
Address Prefixes : {13.64.39.16/32, 13.66.138.92/31, 13.66.140.176/28, 13.67.8.108/31...}
41+
Change Number : 7
42+
43+
Name : ApiManagement.AustraliaCentral
44+
System Service : AzureApiManagement
45+
Region : australiacentral
46+
Address Prefixes : {20.36.106.68/31, 20.36.107.176/28}
47+
Change Number : 2
48+
49+
Name : ApiManagement.AustraliaCentral2
50+
System Service : AzureApiManagement
51+
Region : australiacentral2
52+
Address Prefixes : {20.36.114.20/31, 20.36.115.128/28}
53+
Change Number : 2
54+
55+
Name : ApiManagement.AustraliaEast
56+
System Service : AzureApiManagement
57+
Region : australiaeast
58+
Address Prefixes : {13.70.72.28/31, 13.70.72.240/28, 13.75.217.184/32, 13.75.221.78/32...}
59+
Change Number : 3
60+
61+
Name : ApiManagement.AustraliaSoutheast
62+
System Service : AzureApiManagement
63+
Region : australiasoutheast
64+
Address Prefixes : {13.77.50.68/31, 13.77.52.224/28}
65+
Change Number : 2
66+
67+
...
68+
```
69+
70+
The command gets the list of service tag information resources and stores it in variable `serviceTags`.
71+
72+
### Example 2: Get all address prefixes for AzureSQL
73+
```powershell
74+
PS C:\> $serviceTags = Get-AzNetworkServiceTag -Location eastus2
75+
PS C:\> $sql = $serviceTags.Values | Where-Object { $_.Name -eq "Sql" }
76+
PS C:\> $sql
77+
78+
Name : Sql
79+
System Service : AzureSQL
80+
Address Prefixes : {13.65.31.249/32, 13.65.39.207/32, 13.65.85.183/32, 13.65.200.105/32...}
81+
Change Number : 18
82+
83+
PS C:\> $sql.Properties.AddressPrefixes.Count
84+
644
85+
PS C:\> $sql.Properties.AddressPrefixes
86+
13.65.31.249/32
87+
13.65.39.207/32
88+
13.65.85.183/32
89+
13.65.200.105/32
90+
13.65.209.243/32
91+
...
92+
```
93+
94+
The first command gets the list of service tag information resources and stores it in variable `serviceTags`.
95+
The second command filters the list to select information resource for Sql.
96+
97+
### Example 3: Get Storage's service tag information resource for West US 2
98+
```powershell
99+
PS C:\> $serviceTags = Get-AzNetworkServiceTag -Location eastus2
100+
PS C:\> $serviceTags.Values | Where-Object { $_.Name -eq "Storage.WestUS2" }
101+
102+
Name : Storage.WestUS2
103+
System Service : AzureStorage
104+
Region : westus2
105+
Address Prefixes : {13.66.176.16/28, 13.66.176.48/28, 13.66.232.64/28, 13.66.232.208/28...}
106+
Change Number : 5
107+
108+
PS C:\> $serviceTags.Values | Where-Object { $_.Name -like "Storage*" -and $_.Properties.Region -eq "westus2" }
109+
110+
Name : Storage.WestUS2
111+
System Service : AzureStorage
112+
Region : westus2
113+
Address Prefixes : {13.66.176.16/28, 13.66.176.48/28, 13.66.232.64/28, 13.66.232.208/28...}
114+
Change Number : 5
115+
116+
PS C:\> $serviceTags.Values | Where-Object { $_.Properties.SystemService -eq "AzureStorage" -and $_.Properties.Region -eq "westus2" }
117+
118+
Name : Storage.WestUS2
119+
System Service : AzureStorage
120+
Region : westus2
121+
Address Prefixes : {13.66.176.16/28, 13.66.176.48/28, 13.66.232.64/28, 13.66.232.208/28...}
122+
Change Number : 5
123+
```
124+
125+
The first command gets the list of service tag information resources and stores it in variable `serviceTags`.
126+
The following commands show various way to filter the list to select service tag information for Storage in West US 2.
127+
128+
### Example 4: Get all global service tag information resources
129+
```powershell
130+
PS C:\> $serviceTags = Get-AzNetworkServiceTag -Location eastus2
131+
PS C:\> $serviceTags.Values | Where-Object { -not $_.Properties.Region }
132+
133+
134+
Name : ApiManagement
135+
System Service : AzureApiManagement
136+
Address Prefixes : {13.64.39.16/32, 13.66.138.92/31, 13.66.140.176/28, 13.67.8.108/31...}
137+
Change Number : 7
138+
139+
Name : AppService
140+
System Service : AzureAppService
141+
Address Prefixes : {13.64.73.110/32, 13.65.30.245/32, 13.65.37.122/32, 13.65.39.165/32...}
142+
Change Number : 13
143+
144+
Name : AppServiceManagement
145+
System Service : AzureAppServiceManagement
146+
Address Prefixes : {13.64.115.203/32, 13.66.140.0/26, 13.67.8.128/26, 13.69.64.128/26...}
147+
Change Number : 7
148+
149+
Name : AzureActiveDirectory
150+
System Service : AzureAD
151+
Address Prefixes : {13.64.151.161/32, 13.66.141.64/27, 13.67.9.224/27, 13.67.50.224/29...}
152+
Change Number : 3
153+
154+
Name : AzureActiveDirectoryDomainServices
155+
System Service : AzureIdentity
156+
Address Prefixes : {13.64.151.161/32, 13.66.141.64/27, 13.67.9.224/27, 13.69.66.160/27...}
157+
Change Number : 2
158+
159+
...
34160
```
35161

36-
The command gets the list of service tag information resources.
162+
The first command gets the list of service tag information resources and stores it in variable `serviceTags`.
163+
The second command filters the list to select only those without set region.
37164

38165
## PARAMETERS
39166

0 commit comments

Comments
 (0)