Skip to content

Commit 61b7fe7

Browse files
authored
Merge pull request #223864 from halkazwini/ps-ps
Peering Service: Freshness: Register a Peering Service connection using Azure PowerShell
2 parents ae56704 + a52bc22 commit 61b7fe7

File tree

1 file changed

+46
-69
lines changed

1 file changed

+46
-69
lines changed
Lines changed: 46 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
---
2-
title: 'Register a Peering Service connection - Azure PowerShell '
3-
description: In this tutorial learn how to register a Peering Service connection with PowerShell.
2+
title: Create or change a Peering Service connection - Azure PowerShell
3+
description: Learn how to create or change a Peering Service connection using PowerShell.
44
services: peering-service
55
author: halkazwini
66
ms.service: peering-service
7-
ms.topic: tutorial
8-
ms.date: 05/18/2020
7+
ms.topic: how-to
8+
ms.date: 01/13/2022
99
ms.author: halkazwini
10-
ms.custom: devx-track-azurepowershell
11-
# Customer intent: Customer wants to measure their connection telemetry per prefix to Microsoft services with Azure Peering Service .
10+
ms.custom: template-how-to, devx-track-azurepowershell, engagement-fy23
1211
---
1312

14-
# Tutorial: Register a Peering Service connection using Azure PowerShell
13+
# Create or change a Peering Service connection using PowerShell
1514

16-
In this tutorial, you'll learn how to register Peering Service using Azure PowerShell.
15+
> [!div class="op_single_selector"]
16+
> * [Portal](azure-portal.md)
17+
> * [PowerShell](powershell.md)
18+
> * [Azure CLI](cli.md)
1719
18-
Azure Peering Service is a networking service that enhances customer connectivity to Microsoft cloud services such as Microsoft 365, Dynamics 365, software as a service (SaaS) services, Azure, or any Microsoft services accessible via the public internet. In this article, you'll learn how to register a Peering Service connection by using Azure PowerShell.
20+
Azure Peering Service is a networking service that enhances connectivity to Microsoft cloud services such as Microsoft 365, Dynamics 365, software as a service (SaaS) services, Azure, or any Microsoft services accessible via the public internet.
1921

20-
If you don't have an Azure subscription, create an [account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) now.
22+
In this article, you'll learn how to create and change a Peering Service connection using PowerShell.
23+
24+
If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
2125

2226
[!INCLUDE [cloud-shell-try-it.md](../../includes/cloud-shell-try-it.md)]
2327

@@ -27,109 +31,82 @@ Finally, if you're running PowerShell locally, you'll also need to run `Connect-
2731

2832
Use the Azure PowerShell module to register and manage Peering Service. You can register or manage Peering Service from the PowerShell command line or in scripts.
2933

34+
## Prerequisites
3035

31-
## Prerequisites
32-
You must have the following:
33-
34-
### Azure account
35-
36-
You must have a valid and active Microsoft Azure account. This account is required to set up the Peering Service connection. Peering Service is a resource within Azure subscriptions.
36+
- An Azure subscription.
3737

38-
### Connectivity provider
38+
- A connectivity provider. For more information, see [Peering Service partners](./location-partners.md).
3939

40-
You can work with an internet service provider or internet exchange partner to obtain Peering Service to connect your network with the Microsoft network.
40+
## Register your subscription with the resource provider and feature flag
4141

42-
Make sure that the connectivity providers are partnered with Microsoft.
43-
44-
### Register a subscription with the resource provider and feature flag
45-
46-
Before you proceed to the steps of registering Peering Service, register your subscription with the resource provider and feature flag by using Azure PowerShell. The Azure PowerShell commands are specified here:
42+
Before you proceed to the steps of creating Peering Service, register your subscription with the resource provider and feature flag using [Register-AzResourceProvider](/powershell/module/az.resources/register-azresourceprovider) and [Register-AzProviderFeature](/powershell/module/az.resources/get-azproviderfeature):
4743

4844
```azurepowershell-interactive
49-
Register-AzProviderFeature -FeatureName AllowPeeringService ProviderNamespace Microsoft.Peering
50-
51-
Register-AzResourceProvider -ProviderNamespace Microsoft.Peering
52-
45+
# Register Microsoft.Peering provider.
46+
Register-AzResourceProvider -ProviderNamespace Microsoft.Peering
47+
# Register AllowPeeringService feature.
48+
Register-AzProviderFeature -FeatureName AllowPeeringService -ProviderNamespace Microsoft.Peering
5349
```
5450

55-
### Fetch the location and service provider
56-
57-
Run the following commands in Azure PowerShell to acquire the location and service provider to which the Peering Service should be enabled.
51+
## List Peering Service locations and service providers
5852

59-
Get Peering Service locations:
53+
Use [Get-AzPeeringServiceCountry](/powershell/module/az.peering/get-azpeeringservicecountry) to list the countries where Peering Service is available and [Get-AzPeeringServiceLocation](/powershell/module/az.peering/get-azpeeringservicelocation) to list the available metro locations in each country where you can get the Peering Service:
6054

6155
```azurepowershell-interactive
62-
# Gets a list of available countries
56+
# List the countries available for Peering Service.
6357
Get-AzPeeringServiceCountry
64-
# Gets a list of metro locations serviced by country
58+
# List metro locations serviced in a country
6559
Get-AzPeeringServiceLocation -Country "United States"
6660
```
6761

68-
Get Peering Service providers:
62+
Use [Get-AzPeeringServiceProvider](/powershell/module/az.peering/get-azpeeringserviceprovider) to get a list of available [Peering Service providers](location-partners.md):
6963

7064
```azurepowershell-interactive
7165
Get-AzPeeringServiceProvider
7266
```
7367

74-
### Register the Peering Service connection
68+
## Create a Peering Service connection
7569

76-
Register the Peering Service connection by using the following set of commands via Azure PowerShell. This example registers the Peering Service named myPeeringService.
70+
Create a Peering Service connection using [New-AzPeeringService](/powershell/module/az.peering/new-azpeeringservice):
7771

7872
```azurepowershell-interactive
79-
$loc = "Washington"
80-
$provider = "TestPeer1"
81-
$resourceGroup = "MyResourceGroup"
82-
$name = “myPeeringService”
83-
$peeringService = New-AzPeeringService -ResourceGroupName $resourceGroup -Name $name -PeeringLocation $loc -PeeringServiceProvider $provider
73+
New-AzPeeringService -ResourceGroupName myResourceGroup -Name myPeeringService -PeeringLocation Virginia -PeeringServiceProvider Contoso
8474
```
8575

86-
### Register the Peering Service prefix
76+
## Add the Peering Service prefix
8777

88-
Register the prefix that's provided by the connectivity provider by executing the following commands via Azure PowerShell. This example registers the prefix named myPrefix.
78+
Use [New-AzPeeringServicePrefix](/powershell/module/az.peering/new-azpeeringserviceprefix) to add the prefix provided to you by the connectivity provider:
8979

9080
```azurepowershell-interactive
91-
$loc = "Washington"
92-
$provider = "TestPeer1"
93-
$resourceGroup = "MyResourceGroup"
94-
$name = “myPeeringService”
95-
$peeringService = New-AzPeeringService -ResourceGroupName $resourceGroup -Name $name -PeeringLocation $loc -PeeringServiceProvider $provider
96-
$prefixName = "myPrefix"
97-
$prefix = “192.168.1.0/24”
98-
$serviceKey = "6f48cdd6-2c2e-4722-af89-47e27b2513af"
99-
$prefixService = $peeringService | New-AzPeeringServicePrefix -Name $prefixName -Prefix $prefix -ServiceKey $serviceKey
81+
New-AzPeeringServicePrefix -ResourceGroupName myResourceGroup -PeeringServiceName myPeeringService -Name myPrefix -prefix 240.0.0.0/32 -ServiceKey 00000000-0000-0000-0000-000000000000
10082
```
10183

102-
### List all the Peering Services connections
84+
## List all Peering Services connections
10385

104-
To view the list of all Peering Services, run the following command:
86+
To view the list of all Peering Service connections, use [Get-AzPeeringService](/powershell/module/az.peering/get-azpeeringservice):
10587

10688
```azurepowershell-interactive
107-
$peeringService = Get-AzPeeringService
89+
Get-AzPeeringService | Format-Table Name, PeeringServiceLocation, PeeringServiceProvider, Location
10890
```
10991

110-
### List all the Peering Service prefixes
111-
112-
To view the list of all Peering Service prefixes, run the following command:
92+
## List all Peering Service prefixes
11393

114-
```azurepowershell-interactive
115-
$prefixName = "myPrefix"
116-
```
94+
To view the list of all Peering Service prefixes, use [Get-AzPeeringServicePrefix](/powershell/module/az.peering/get-azpeeringserviceprefix):
11795

11896
```azurepowershell-interactive
119-
$prefix = Get-AzPeeringServicePrefix -PeeringServiceName "myPeeringService" -ResourceGroupName "MyResourceGroup" -Name "myPrefix"
97+
Get-AzPeeringServicePrefix -PeeringServiceName myPeeringService -ResourceGroupName myResourceGroup
12098
```
12199

122-
### Remove the Peering Service prefix
100+
## Remove the Peering Service prefix
123101

124-
To remove the Peering Service prefix, run the following command:
102+
To remove the Peering Service prefix, use [Remove-AzPeeringServicePrefix](/powershell/module/az.peering/remove-azpeeringserviceprefix):
125103

126104
```azurepowershell-interactive
127-
Remove-AzPeeringServicePrefix -ResourceGroupName "MyResourceGroup" -Name "myPrefix" -PeeringServiceName "myPeeringService"
105+
Remove-AzPeeringServicePrefix -ResourceGroupName myResourceGroup -Name myPeeringService -PrefixName myPrefix
128106
```
129107

130108
## Next steps
131109

132-
- To learn about Peering Service connection, see [Peering Service connection](connection.md).
133-
- To learn about Peering Service connection telemetry, see [Peering Service connection telemetry](connection-telemetry.md).
134-
- To register a Peering Service connection by using the Azure portal, see [Register a Peering Service connection - Azure portal](azure-portal.md).
135-
- To register a Peering Service connection by using the Azure CLI, see [Register a Peering Service connection - Azure CLI](cli.md).
110+
- To learn more about Peering Service connection, see [Peering Service connection](connection.md).
111+
- To learn more about Peering Service connection telemetry, see [Peering Service connection telemetry](connection-telemetry.md).
112+
- To measure Peering Service connection telemetry, see [Measure connection telemetry](measure-connection-telemetry.md).

0 commit comments

Comments
 (0)