1 minutes to read

Recently I was working on a migration from ASM to ASR where an ExpressRoute and VNET-to-VNET was involved. In this migration I wanted to migrate everything away from ASM to ARM. In documentation found on the internet I found how to move the ExpressRoute from classic to Resource Manager. However this document doesn’t describe how to migrate completely away from classic. More about the migration from Classic to Resource manager in my article ASM to ARM migration.

During this migration I ran into some issues regarding the Virtual Network Gateway configuration with PowerShell. As you can reed in my other post you’ll need to run some PowerShell commands to break the VNET-to-VNET connections and to unlink the ExpressRoute from the classic circuit.

With different commands in PowerShell i ran into errors like the ones shown below:

PS Z:\> Get-AzureVirtualNetworkGatewayConnection
Get-AzureVirtualNetworkGatewayConnection : TimeoutError: Request to a downlevel service timed out.
At line:1 char:1
+ Get-AzureVirtualNetworkGatewayConnection
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Get-AzureVirtualNetworkGatewayConnection], CloudException
    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.GetAzureVirtualNetworkConnectionGateway

or

PS Z:\> Get-AzureDedicatedCircuitLink -ServiceKey '********-****-****-****-************'
Get-AzureDedicatedCircuitLink : InternalError: The server encountered an internal error. Please retry the request.
At line:1 char:1
+ Get-AzureDedicatedCircuitLink
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Get-AzureDedicatedCircuitLink], CloudException

It appears that I forgot to enable the ExpressRoute to allow classic operations:

$ckt = Get-AzureRmExpressRouteCircuit -Name "[ExpressRoute name in ARM]" -ResourceGroupName "[Name of the Resource Group where your ExpressRoute is created]"
$ckt.AllowClassicOperations = $true
Set-AzureRmExpressRouteCircuit -ExpressRouteCircuit $ckt

After allowing classic operations on the ExpressRoute all the commands started working. Always make sure you follow the documentation 100% and make sure your Azure PowerShell is up-to-date.