Create, change, or delete a Peering Service connection using the Azure CLI
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 create, change, and delete a Peering Service connection using the Azure CLI.
If you don't have an Azure subscription, create a free account before you begin.
Use the Bash environment in Azure Cloud Shell. For more information, see Quickstart for Bash in Azure Cloud Shell.
If you prefer to run CLI reference commands locally, install the Azure CLI. If you're running on Windows or macOS, consider running Azure CLI in a Docker container. For more information, see How to run the Azure CLI in a Docker container.
If you're using a local installation, sign in to the Azure CLI by using the az login command. To finish the authentication process, follow the steps displayed in your terminal. For other sign-in options, see Sign in with the Azure CLI.
When you're prompted, install the Azure CLI extension on first use. For more information about extensions, see Use extensions with the Azure CLI.
Run az version to find the version and dependent libraries that are installed. To upgrade to the latest version, run az upgrade.
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 to find the version and dependent libraries that are installed. To upgrade to the latest version, run az upgrade. If using Azure Cloud Shell, the latest version is already installed.
Prerequisites
An Azure subscription.
A connectivity provider. For more information, see Peering Service partners.
Register your subscription with the resource provider and feature flag
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 and az provider register:
az feature register --namespace Microsoft.Peering --name AllowPeeringService
az provider register --name Microsoft.Peering
List Peering Service locations and service providers
Use az peering service country list to list the countries where Peering Service is available and az peering service location list to list the available metro locations in a specific country where you can get the Peering Service:
# List the countries available for Peering Service.
az peering service country list --out table
# List metro locations serviced in a country
az peering service location list --country "united states" --output table
Use az peering service provider list to get a list of available Peering Service providers:
az peering service provider list --output table
Create a Peering Service connection
Create a Peering Service connection using az peering service create:
az peering service create --location "eastus" --peering-service-name "myPeeringService" --resource-group "myResourceGroup" --peering-service-location "Virginia" --peering-service-provider "Contoso"
Add the Peering Service prefix
Use az peering service prefix create to add the prefix provided to you by the connectivity provider:
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"
List all Peering Services connections
To view the list of all Peering Service connections, use az peering service list:
az peering service list --resource-group "myresourcegroup" --output "table"
List all Peering Service prefixes
To view the list of all Peering Service prefixes, use az peering service prefix list:
az peering service prefix list --peering-service-name "myPeeringService" --resource-group "myResourceGroup"
Remove the Peering Service prefix
To remove a Peering Service prefix, use az peering service prefix delete:
az peering service prefix delete --peering-service-name "myPeeringService" --prefix-name "myPrefix" --resource-group "myResourceGroup"
Delete a Peering Service connection
To delete a Peering Service connection, use az peering service delete:
az peering service delete --peering-service-name "myPeeringService" --resource-group "myResourceGroup"
Next steps
- To learn more about Peering Service connection, see Peering Service connection.
- To learn more about Peering Service connection telemetry, see Peering Service connection telemetry.
- To measure Peering Service connection telemetry, see Measure connection telemetry.
Feedback
Submit and view feedback for