Configure ExpressRoute Direct by using the Azure CLI
Article
ExpressRoute Direct gives you the ability to directly connect to Microsoft's global network through peering locations strategically distributed across the world. For more information, see About ExpressRoute Direct Connect.
Before you begin
Before using ExpressRoute Direct, you must first enroll your subscription. Before using ExpressRoute Direct, you must first enroll your subscription. To enroll, please do the following via Azure PowerShell:
Sign in to Azure and select the subscription you wish to enroll.
Azure PowerShell
Connect-AzAccountSelect-AzSubscription -Subscription"<SubscriptionID or SubscriptionName>"
Register your subscription for Public Preview using the following command:
Once enrolled, verify that the Microsoft.Network resource provider is registered to your subscription. Registering a resource provider configures your subscription to work with the resource provider.
Create the resource
Sign in to Azure and select the subscription that contains ExpressRoute. The ExpressRoute Direct resource and your ExpressRoute circuits must be in the same subscription. In the Azure CLI, run the following commands:
Azure CLI
az login
Check the subscriptions for the account:
Azure CLI
az account list
Select the subscription for which you want to create an ExpressRoute circuit:
Azure CLI
az account set --subscription"<subscription ID>"
Re-register your subscription to Microsoft.Network to access the expressrouteportslocation and expressrouteport APIs
Azure CLI
az provider register --namespace Microsoft.Network
List all locations where ExpressRoute Direct is supported:
Create an ExpressRoute Direct resource that's based on the location you chose in the preceding steps.
ExpressRoute Direct supports both QinQ and Dot1Q encapsulation. If you select QinQ, each ExpressRoute circuit is dynamically assigned an S-Tag and is unique throughout the ExpressRoute Direct resource. Each C-Tag on the circuit must be unique on the circuit but not across the ExpressRoute Direct resource.
If you select Dot1Q encapsulation, you must manage uniqueness of the C-Tag (VLAN) across the entire ExpressRoute Direct resource.
Important
ExpressRoute Direct can be only one encapsulation type. You can't change the encapsulation type after you create the ExpressRoute Direct resource.
Azure CLI
az network express-route port create -n$name-g$RGName--bandwidth100 gbps --encapsulation QinQ | Dot1Q --peering-location$PeeringLocationName-l$AzureRegion
Note
You also can set the Encapsulation attribute to Dot1Q.
Input the recently created ExpressRoute Direct resource name, resource group name, and a customer name to write the LOA to and (optionally) define a file location to store the document. If a file path is not referenced, the document will download to the current directory.
Azure CLI
az network express-route port generate-loa -n Contoso-Direct-g Contoso-Direct-rg--customer-name Contoso --destination C:\Users\SampleUser\Downloads\LOA.pdf
Change AdminState for links
Use this process to conduct a layer 1 test. Ensure that each cross-connection is properly patched into each router in the primary and secondary ports.
Set links to Enabled. Repeat this step to set each link to Enabled.
Links[0] is the primary port and Links[1] is the secondary port.
Azure CLI
az network express-route port update -n Contoso-Direct-g Contoso-Direct-rg--setlinks[0].adminState="Enabled"
Azure CLI
az network express-route port update -n Contoso-Direct-g Contoso-Direct-rg--setlinks[1].adminState="Enabled"
Use the same procedure to down the ports by using AdminState = "Disabled".
Create a circuit
By default, you can create 10 circuits in the subscription that contains the ExpressRoute Direct resource. Microsoft Support can increase the default limit. You're responsible for tracking provisioned and utilized bandwidth. Provisioned bandwidth is the sum of the bandwidth of all the circuits on the ExpressRoute Direct resource. Utilized bandwidth is the physical usage of the underlying physical interfaces.
You can use additional circuit bandwidths on ExpressRoute Direct only to support the scenarios outlined here. The bandwidths are 40 Gbps and 100 Gbps.
SkuTier can be Local, Standard, or Premium.
SkuFamily can only be MeteredData at creation. You can change to Unlimited after the creation of the circuit by updating the sku-family.
Note
Once you change to Unlimited data, you can't change back without needing to recreate the ExpressRoute circuit.
Create a circuit on the ExpressRoute Direct resource:
Azure CLI
az network express-route create --express-route-port"/subscriptions/<subscriptionID>/resourceGroups/Contoso-Direct-rg/providers/Microsoft.Network/expressRoutePorts/Contoso-Direct"-n"Contoso-Direct-ckt"-g"Contoso-Direct-rg"--sku-family MeteredData --sku-tier Standard --bandwidth100 Gbps --location$AzureRegion
Other bandwidths include 5 Gbps, 10 Gbps, and 40 Gbps.