Create an ExpressRoute circuit by using Azure Resource Manager template
Learn how to create an ExpressRoute circuit by deploying an Azure Resource Manager template by using Azure PowerShell. For more information on developing Resource Manager templates, see Resource Manager documentation and the template reference.
Before you begin
- Review the prerequisites and workflows before you begin configuration.
- Ensure that you have permissions to create new networking resources. Contact your account administrator if you do not have the right permissions.
Create and provision an ExpressRoute circuit
Azure Quickstart Templates has a good collection of Resource Manager template. You use one of the existing templates to create an ExpressRoute circuit.
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.5.6.12127",
"templateHash": "14062891962288443864"
}
},
"parameters": {
"circuitName": {
"type": "string",
"metadata": {
"description": "This is the name of the ExpressRoute circuit"
}
},
"serviceProviderName": {
"type": "string",
"metadata": {
"description": "This is the name of the ExpressRoute Service Provider. It must exactly match one of the Service Providers from List ExpressRoute Service Providers API call."
}
},
"peeringLocation": {
"type": "string",
"metadata": {
"description": "This is the name of the peering location and not the ARM resource location. It must exactly match one of the available peering locations from List ExpressRoute Service Providers API call."
}
},
"bandwidthInMbps": {
"type": "int",
"metadata": {
"description": "This is the bandwidth in Mbps of the circuit being created. It must exactly match one of the available bandwidth offers List ExpressRoute Service Providers API call."
}
},
"skuTier": {
"type": "string",
"defaultValue": "Standard",
"allowedValues": [
"Standard",
"Premium"
],
"metadata": {
"description": "Chosen SKU Tier of ExpressRoute circuit. Choose from Premium or Standard SKU tiers."
}
},
"skuFamily": {
"type": "string",
"defaultValue": "MeteredData",
"allowedValues": [
"MeteredData",
"UnlimitedData"
],
"metadata": {
"description": "Chosen SKU family of ExpressRoute circuit. Choose from MeteredData or UnlimitedData SKU families."
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Location for all resources."
}
}
},
"resources": [
{
"type": "Microsoft.Network/expressRouteCircuits",
"apiVersion": "2021-02-01",
"name": "[parameters('circuitName')]",
"location": "[parameters('location')]",
"sku": {
"name": "[format('{0}_{1}', parameters('skuTier'), parameters('skuFamily'))]",
"tier": "[parameters('skuTier')]",
"family": "[parameters('skuFamily')]"
},
"properties": {
"serviceProviderProperties": {
"serviceProviderName": "[parameters('serviceProviderName')]",
"peeringLocation": "[parameters('peeringLocation')]",
"bandwidthInMbps": "[parameters('bandwidthInMbps')]"
}
}
}
]
}
To see more related templates, select here.
To create an ExpressRoute Circuit by deploying a template:
Follow the instructions to sign in to the Azure.
$circuitName = Read-Host -Prompt "Enter a circuit name" $location = Read-Host -Prompt "Enter the location (i.e. chinaeast)" $resourceGroupName = "${circuitName}rg" $templateUri = "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.network/expressroute-circuit-create/azuredeploy.json" $serviceProviderName = "Shanghai Telecom Ethernet" $peeringLocation = "Shanghai" $bandwidthInMbps = 500 $sku_tier = "Premium" $sku_family = "MeteredData" New-AzResourceGroup -Name $resourceGroupName -Location $location New-AzResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateUri $templateUri -circuitName $circuitName -serviceProviderName $serviceProviderName -peeringLocation $peeringLocation -bandwidthInMbps $bandwidthInMbps -sku_tier $sku_tier -sku_family $sku_family Write-Host "Press [ENTER] to continue ..."
SKU tier determines whether an ExpressRoute circuit is Standard or Premium. You can specify Standard or Premium.
SKU family determines the billing type. You can specify Metereddata for a metered data plan and Unlimiteddata for an unlimited data plan. You can change the billing type from Metereddata to Unlimiteddata, but you can't change the type from Unlimiteddata to Metereddata. A Local circuit is Unlimiteddata only.
Peering Location is the physical location where you are peering with Microsoft.
Important
The Peering Location indicates the physical location where you are peering with Microsoft. This is not linked to "Location" property, which refers to the geography where the Azure Network Resource Provider is located. While they are not related, it is a good practice to choose a Network Resource Provider geographically close to the Peering Location of the circuit.
The resource group name is the service bus namespace name with rg appended.
Select Copy to copy the PowerShell script.
Right-click the shell console, and then select Paste.
It takes a few moments to create an event hub.
Azure PowerShell is used to deploy the template in this tutorial. For other template deployment methods, see:
Deprovisioning and deleting an ExpressRoute circuit
You can delete your ExpressRoute circuit by selecting the delete icon. Note the following information:
- You must unlink all virtual networks from the ExpressRoute circuit. If this operation fails, check whether any virtual networks are linked to the circuit.
- If the ExpressRoute circuit service provider provisioning state is Provisioning or Provisioned you must work with your service provider to deprovision the circuit on their side. We continue to reserve resources and bill you until the service provider completes deprovisioning the circuit and notifies us.
- If the service provider has deprovisioned the circuit (the service provider provisioning state is set to Not provisioned), you can delete the circuit. This stops billing for the circuit.
You can delete your ExpressRoute circuit by running the following PowerShell command:
$circuitName = Read-Host -Prompt "Enter the same circuit name that you used earlier"
$resourceGroupName = "${circuitName}rg"
Remove-AzExpressRouteCircuit -ResourceGroupName $resourceGroupName -Name $circuitName
Next steps
After you create your circuit, continue with the following next steps: