Skip to content

Commit c35e4bf

Browse files
Merge pull request #224461 from halkazwini/ps-cli2
Peering Service: Freshness: Register a Peering Service connection by using the Azure CLI
2 parents 8ed3e29 + f5f4d72 commit c35e4bf

File tree

1 file changed

+64
-42
lines changed
  • articles/peering-service

1 file changed

+64
-42
lines changed

articles/peering-service/cli.md

Lines changed: 64 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,115 @@
11
---
2-
title: Register a Peering Service Preview connection by using the Azure CLI
3-
description: Learn how to register a Peering Service connection by using the Azure CLI
2+
title: Create, change, or delete a Peering Service connection - Azure CLI
3+
description: Learn how to create, change, or delete a Peering Service connection using the Azure CLI
44
services: peering-service
55
author: halkazwini
66
ms.service: peering-service
77
ms.topic: how-to
8-
ms.tgt_pltfrm: na
98
ms.workload: Infrastructure-services
10-
ms.date: 05/2/2020
9+
ms.date: 01/19/2023
1110
ms.author: halkazwini
11+
ms.custom: template-how-to, engagement-fy23
1212
---
1313

14-
# Register a Peering Service connection by using the Azure CLI
14+
# Create, change, or delete a Peering Service connection using the Azure CLI
1515

16-
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 the Azure CLI.
16+
> [!div class="op_single_selector"]
17+
> * [Portal](azure-portal.md)
18+
> * [PowerShell](powershell.md)
19+
> * [Azure CLI](cli.md)
1720
18-
- This article requires version 2.0.28 or later of the Azure CLI. Run [az version](/cli/azure/reference-index#az-version) to find the version and dependent libraries that are installed. To upgrade to the latest version, run [az upgrade](/cli/azure/reference-index#az-upgrade).
21+
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.
22+
23+
In this article, you'll learn how to create, change, and delete a Peering Service connection using the Azure CLI.
24+
25+
If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
26+
27+
[!INCLUDE [azure-cli-prepare-your-environment-h3.md](~/articles/reusable-content/azure-cli/azure-cli-prepare-your-environment-no-header.md)]
28+
29+
If you decide to install and use Azure CLI locally, this article requires you to use version 2.0.28 or later of the Azure CLI. Run [az version](/cli/azure/reference-index#az-version) to find the version and dependent libraries that are installed. To upgrade to the latest version, run [az upgrade](/cli/azure/reference-index#az-upgrade). If using Azure Cloud Shell, the latest version is already installed.
1930

2031
## Prerequisites
2132

22-
You must have the following:
33+
- An Azure subscription.
34+
35+
- A connectivity provider. For more information, see [Peering Service partners](./location-partners.md).
2336

24-
### Azure account
37+
## Register your subscription with the resource provider and feature flag
2538

26-
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.
39+
Before you proceed to the steps of creating the Peering Service connection, register your subscription with the resource provider and feature flag using [az feature register](/cli/azure/feature.md#az-feature-register) and [az provider register](/cli/azure/provider.md#az-provider-register):
40+
41+
```azurecli-interactive
42+
az feature register --namespace Microsoft.Peering --name AllowPeeringService
43+
az provider register --name Microsoft.Peering
44+
```
2745

28-
### Connectivity provider
46+
## List Peering Service locations and service providers
2947

30-
You can work with an internet service provider or internet exchange partner to obtain Peering Service to connect your network with the Microsoft network.
48+
Use [az peering service country list](/cli/azure/peering/service/country.md#az-peering-service-country-list) to list the countries where Peering Service is available and [az peering service location list](/cli/azure/peering/service/location.md#az-peering-service-location-list) to list the available metro locations in a specific country where you can get the Peering Service:
3149

32-
Make sure that the connectivity providers are partnered with Microsoft.
50+
```azurecli-interactive
51+
# List the countries available for Peering Service.
52+
az peering service country list --out table
53+
# List metro locations serviced in a country
54+
az peering service location list --country "united states" --output table
55+
```
3356

34-
[!INCLUDE [azure-cli-prepare-your-environment-h3.md](~/articles/reusable-content/azure-cli/azure-cli-prepare-your-environment-h3.md)]
57+
Use [az peering service provider list](/cli/azure/peering/service/provider.md#az-peering-service-provider-list) to get a list of available [Peering Service providers](location-partners.md):
3558

36-
- This article requires version 2.0.28 or later of the Azure CLI. If using Azure Cloud Shell, the latest version is already installed.
59+
```azurecli-interactive
60+
az peering service provider list --output table
61+
```
3762

38-
### 1. Select your subscription
63+
## Create a Peering Service connection
3964

40-
Select the subscription for which you want to register the Peering Service connection.
65+
Create a Peering Service connection using [az peering service create](/cli/azure/peering/service.md#az-peering-service-create):
4166

4267
```azurecli-interactive
43-
az account set --subscription "<subscription ID>"
68+
az peering service create --location "eastus" --peering-service-name "myPeeringService" --resource-group "myResourceGroup" --peering-service-location "Virginia" --peering-service-provider "Contoso"
4469
```
4570

46-
If you don't already have a resource group, you must create one before you register your Peering Service connection. You can create a resource group by running the following command:
71+
## Add the Peering Service prefix
72+
73+
Use [az peering service prefix create](/cli/azure/peering/service/prefix.md#az-peering-service-prefix-create) to add the prefix provided to you by the connectivity provider:
4774

4875
```azurecli-interactive
49-
az group create -n MyResourceGroup -l "West US"
76+
az peering service prefix create --peering-service-name "myPeeringService" --prefix-name "myPrefix" --resource-group "myResourceGroup" --peering-service-prefix-key "00000000-0000-0000-0000-000000000000" --prefix "240.0.0.0/32"
5077
```
5178

52-
### 2. Register your subscription with the resource provider and feature flag
79+
## List all Peering Services connections
5380

54-
Before you proceed to the steps of registering the Peering Service connection by using the Azure CLI, register your subscription with the resource provider and feature flag by using the Azure CLI. The Azure CLI commands are specified here:
81+
To view the list of all Peering Service connections, use [az peering service list](/cli/azure/peering/service.md#az-peering-service-list):
5582

5683
```azurecli-interactive
84+
az peering service list --resource-group "myresourcegroup" --output "table"
85+
```
5786

58-
az feature register --namespace Microsoft.Peering --name AllowPeeringService
87+
## List all Peering Service prefixes
5988

89+
To view the list of all Peering Service prefixes, use [az peering service prefix list](/cli/azure/peering/service/prefix.md#az-peering-service-prefix-list):
90+
91+
```azurecli-interactive
92+
az peering service prefix list --peering-service-name "myPeeringService" --resource-group "myResourceGroup"
6093
```
6194

62-
### 3. Register the Peering Service connection
95+
## Remove the Peering Service prefix
6396

64-
Register the Peering Service connection by using the following set of commands via the Azure CLI. This example registers the Peering Service connection named myPeeringService.
97+
To remove a Peering Service prefix, use [az peering service prefix delete](/cli/azure/peering/service/prefix.md#az-peering-service-prefix-delete):
6598

6699
```azurecli-interactive
67-
az peering service create : Create peering service\
68-
--location -l \
69-
--name myPeeringService\
70-
--resource-group -g MyResourceGroup\
71-
--peering-service-location\
72-
--peering-service-provider\
73-
--tags
100+
az peering service prefix delete --peering-service-name "myPeeringService" --prefix-name "myPrefix" --resource-group "myResourceGroup"
74101
```
75102

76-
### 4. Register the prefix
103+
## Delete a Peering Service connection
77104

78-
Register the prefix that's provided by the connectivity provider by executing the following commands via the Azure CLI. This example registers the prefix named myPrefix.
105+
To delete a Peering Service connection, use [az peering service delete](/cli/azure/peering/service.md#az-peering-service-delete):
79106

80107
```azurecli-interactive
81-
az peering service prefix create \
82-
--name myPrefix\
83-
--peering-service-name myPeeringService\
84-
--resource-group -g myResourceGroup\
108+
az peering service delete --peering-service-name "myPeeringService" --resource-group "myResourceGroup"
85109
```
86110

87111
## Next steps
88112

89113
- To learn more about Peering Service connection, see [Peering Service connection](connection.md).
90-
- To learn about Peering Service connection telemetry, see [Peering Service connection telemetry](connection-telemetry.md).
91-
- To measure telemetry, see [Measure connection telemetry](measure-connection-telemetry.md).
92-
- To register the connection by using Azure PowerShell, see [Register a Peering Service connection - Azure PowerShell](powershell.md).
93-
- To register the connection by using the Azure portal, see [Register a Peering Service connection - Azure portal](azure-portal.md).
114+
- To learn more about Peering Service connection telemetry, see [Peering Service connection telemetry](connection-telemetry.md).
115+
- To measure Peering Service connection telemetry, see [Measure connection telemetry](measure-connection-telemetry.md).

0 commit comments

Comments
 (0)