|
1 | 1 | ---
|
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 |
4 | 4 | services: peering-service
|
5 | 5 | author: halkazwini
|
6 | 6 | ms.service: peering-service
|
7 | 7 | ms.topic: how-to
|
8 |
| -ms.tgt_pltfrm: na |
9 | 8 | ms.workload: Infrastructure-services
|
10 |
| -ms.date: 05/2/2020 |
| 9 | +ms.date: 01/19/2023 |
11 | 10 | ms.author: halkazwini
|
| 11 | +ms.custom: template-how-to, engagement-fy23 |
12 | 12 | ---
|
13 | 13 |
|
14 |
| -# Register a Peering Service connection by using the Azure CLI |
| 14 | +# Create, change, or delete a Peering Service connection using the Azure CLI |
15 | 15 |
|
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) |
17 | 20 |
|
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. |
19 | 30 |
|
20 | 31 | ## Prerequisites
|
21 | 32 |
|
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). |
23 | 36 |
|
24 |
| -### Azure account |
| 37 | +## Register your subscription with the resource provider and feature flag |
25 | 38 |
|
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 | +``` |
27 | 45 |
|
28 |
| -### Connectivity provider |
| 46 | +## List Peering Service locations and service providers |
29 | 47 |
|
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: |
31 | 49 |
|
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 | +``` |
33 | 56 |
|
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): |
35 | 58 |
|
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 | +``` |
37 | 62 |
|
38 |
| -### 1. Select your subscription |
| 63 | +## Create a Peering Service connection |
39 | 64 |
|
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): |
41 | 66 |
|
42 | 67 | ```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" |
44 | 69 | ```
|
45 | 70 |
|
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: |
47 | 74 |
|
48 | 75 | ```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" |
50 | 77 | ```
|
51 | 78 |
|
52 |
| -### 2. Register your subscription with the resource provider and feature flag |
| 79 | +## List all Peering Services connections |
53 | 80 |
|
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): |
55 | 82 |
|
56 | 83 | ```azurecli-interactive
|
| 84 | +az peering service list --resource-group "myresourcegroup" --output "table" |
| 85 | +``` |
57 | 86 |
|
58 |
| -az feature register --namespace Microsoft.Peering --name AllowPeeringService |
| 87 | +## List all Peering Service prefixes |
59 | 88 |
|
| 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" |
60 | 93 | ```
|
61 | 94 |
|
62 |
| -### 3. Register the Peering Service connection |
| 95 | +## Remove the Peering Service prefix |
63 | 96 |
|
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): |
65 | 98 |
|
66 | 99 | ```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" |
74 | 101 | ```
|
75 | 102 |
|
76 |
| -### 4. Register the prefix |
| 103 | +## Delete a Peering Service connection |
77 | 104 |
|
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): |
79 | 106 |
|
80 | 107 | ```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" |
85 | 109 | ```
|
86 | 110 |
|
87 | 111 | ## Next steps
|
88 | 112 |
|
89 | 113 | - 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