I had a scenario where when I ran Get-AzureRmExpressRouteServiceProvider in a new Azure tenant I would get the following error in PowerShell.
Get-AzureRmExpressRouteServiceProvider : Subscription a4ca03ea-42e4-4a18-a50f-79bcc53907e4 is not registered with NRP.
At line:1 char:1
+ CategoryInfo : CloseError: (:) [Get-AzureRmExpressRouteServiceProvider], CloudException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Network.GetAzureExpressRouteServiceProviderCommand
This is one of the required cmdlets in configuring ExpressRoute. The fix is to use the following cmdlets to create the required objects that are not mentioned in the ExpressRoute setup article at https://azure.microsoft.com/en-us/documentation/articles/expressroute-howto-circuit-arm/ and then return to this article and complete the rest of the setup.
- First, ensure you are logged into Azure PowerShell using the Resource Manager cmdlets (see https://azure.microsoft.com/en-us/blog/azps-1-0/ for steps to install these) and Login-AzureRMAccount to login to the correct tenant
- Second, select your subscription with Get-AzureRMSubscription followed by Select-AzureRMSubscription –SubscriptionName “Free Trial”. Replace “Free Trial” with the name of your subscription.
- Run Get-AzureRmExpressRouteServiceProvider – you should get the above error. If not then this blog post is not relevant to you
- Create a resource group and then create a virtual network inside this resource group. These settings will need to be set to something suitable for your network. Suitable means not overlapping with any subnet on-premises. The AzureRM PowerShell to do this looks like the following:
- You can now run Get-AzureRmExpressRouteServiceProvider without error and continue creating your ExpressRoute request and obtain your service key
# Create a VNet with two (or more subnets). First subnet must be named GatewaySubnet and min /28
$Location = “West Europe”
New-AzureRmResourceGroup -Name “InternalNetworkResourceGroup” -Location $Location
$GatewaySubnet = New-AzureRmVirtualNetworkSubnetConfig -Name ‘GatewaySubnet’ -AddressPrefix 192.168.192.0/28
$LANSubnet1 = New-AzureRmVirtualNetworkSubnetConfig -Name ‘AzureLAN1’ -AddressPrefix ‘192.168.192.16/28’
New-AzureRmVirtualNetwork -Name AzureInternal -ResourceGroupName “InternalNetworkResourceGroup” -Location $Location -AddressPrefix 192.168.192.0/24 -Subnet $LANSubnet1,$GatewaySubnet