Move ExpressRoute circuits from classic to Resource Manager deployment model using PowerShell
To use an ExpressRoute circuit for both the classic and Resource Manager deployment models, you must move the circuit to the Resource Manager deployment model. The following sections help you move your circuit by using PowerShell.
Before you begin
The steps and examples in this article use Azure PowerShell Az modules. To install the Az modules locally on your computer, see Install Azure PowerShell. To learn more about the new Az module, see Introducing the new Azure PowerShell Az module. PowerShell cmdlets are updated frequently. If you are not running the latest version, the values specified in the instructions may fail. To find the installed versions of PowerShell on your system, use the Get-Module -ListAvailable Az
cmdlet.
- Verify that you have installed both the classic and Az Azure PowerShell modules locally on your computer. For more information, see How to install and configure Azure PowerShell.
- Make sure that you have reviewed the prerequisites, routing requirements, and workflows before you begin configuration.
- Review the information that is provided under Moving an ExpressRoute circuit from classic to Resource Manager. Make sure that you fully understand the limits and limitations.
- Verify that the circuit is fully operational in the classic deployment model.
- Ensure that you have a resource group that was created in the Resource Manager deployment model.
Move an ExpressRoute circuit
Step 1: Gather circuit details from the classic deployment model
Sign in to the Azure classic environment and gather the service key.
Sign in to your Azure account.
Add-AzureAccount -Environment AzureChinaCloud
Select the appropriate Azure subscription.
Select-AzureSubscription "<Enter Subscription Name here>"
Import the PowerShell modules for Azure and ExpressRoute.
Import-Module 'C:\Program Files\WindowsPowerShell\Modules\Azure\5.1.1\Azure\Azure.psd1' Import-Module 'C:\Program Files\WindowsPowerShell\Modules\Azure\5.1.1\ExpressRoute\ExpressRoute.psd1'
Use the cmdlet below to get the service keys for all of your ExpressRoute circuits. After retrieving the keys, copy the service key of the circuit that you want to move to the Resource Manager deployment model.
Get-AzureDedicatedCircuit
Step 2: Sign in and create a resource group
Sign in to the Resource Manager environment and create a new resource group.
Sign in to your Azure Resource Manager environment.
Connect-AzAccount -Environment AzureChinaCloud
Select the appropriate Azure subscription.
Get-AzSubscription -SubscriptionName "<Enter Subscription Name here>" | Select-AzSubscription
Modify the snippet below to create a new resource group if you don't already have a resource group.
New-AzResourceGroup -Name "DemoRG" -Location "China North"
Step 3: Move the ExpressRoute circuit to the Resource Manager deployment model
You are now ready to move your ExpressRoute circuit from the classic deployment model to the Resource Manager deployment model. Before proceeding, review the information provided in Moving an ExpressRoute circuit from the classic to the Resource Manager deployment model.
To move your circuit, modify and run the following snippet:
Move-AzExpressRouteCircuit -Name "MyCircuit" -ResourceGroupName "DemoRG" -Location "China North" -ServiceKey "<Service-key>"
In classic mode, an ExpressRoute circuit does not have the concept of being tied to a region. However, in Resource Manager, every resource needs to be mapped to an Azure region. The region specified in the Move-AzExpressRouteCircuit cmdlet can technically be any region. For organizational purposes, you may want to choose a region that closely represents your peering location.
Note
- After moving your classic ExpressRoute circuit to the Resource Manager deployment model, it will have access to both the classic and Resource Manager deployment models by default.
- The new name that is listed in the previous cmdlet will be used to address the resource. The circuit will essentially be renamed.
Modify circuit access
To enable ExpressRoute circuit access for both deployment models
You can enable access to the classic deployment model for ExpressRoute circuits that were created in the Resource Manager deployment model. Run the following cmdlets to enable access to both deployment models:
Get the circuit details.
$ckt = Get-AzExpressRouteCircuit -Name "DemoCkt" -ResourceGroupName "DemoRG"
Set "Allow Classic Operations" to TRUE.
$ckt.AllowClassicOperations = $true
Update the circuit. After this operation has finished successfully, you will be able to view the circuit in the classic deployment model.
Set-AzExpressRouteCircuit -ExpressRouteCircuit $ckt
Run the following cmdlet to get the details of the ExpressRoute circuit. You must be able to see the service key listed.
get-azurededicatedcircuit
You can now manage links to the ExpressRoute circuit using the classic deployment model commands for classic VNets, and the Resource Manager commands for Resource Manager VNets. The following articles help you manage links to the ExpressRoute circuit:
To disable ExpressRoute circuit access to the classic deployment model
Run the following cmdlets to disable access to the classic deployment model.
Get details of the ExpressRoute circuit.
$ckt = Get-AzExpressRouteCircuit -Name "DemoCkt" -ResourceGroupName "DemoRG"
Set "Allow Classic Operations" to FALSE.
$ckt.AllowClassicOperations = $false
Update the circuit. After this operation has finished successfully, you will not be able to view the circuit in the classic deployment model.
Set-AzExpressRouteCircuit -ExpressRouteCircuit $ckt