Monday, 30 July 2018

Azure ASM to ARM upgradation.

Error: Virtual network "Vnet Name" not found. Either it does not exist or it is an Azure Resource Manager resource, which cannot be used with Cloud Services


Migrate resources connected to Vnet .. Below script will migrate all resources belongs to Vnet.

#Migrate all VMs usig Vnet...
#Login Classic Portal
Add-AzureAccount
Get-AzureSubscription | ft SubscriptionName
Select-AzureSubscription -SubscriptionName "Microsoft Azure"
#Login with ARM Account.
Login-AzureRmAccount
Get-AzureRMSubscription | Sort SubscriptionName | Select SubscriptionName
Select-AzureRmSubscription -SubscriptionName "Microsoft Azure"

#Register with the migration resource provider by using the following command:
Register-AzureRmResourceProvider -ProviderNamespace Microsoft.ClassicInfrastructureMigrate
#Wait Until it get register,, Make sure that Registration State is REGISTER before you proceed
Get-AzureRmResourceProvider -ProviderNamespace Microsoft.ClassicInfrastructureMigrate
#Select VnetName, where all VMs are connected to.

$vnetname = "vnet"
$validate = Move-AzureVirtualNetwork -Validate -VirtualNetworkName $vnetName
$validate.ValidationMessages

# Prepare if got success then only commit it or else remove # From last line and abort the operation and go babck to prious state.
Move-AzureVirtualNetwork -Prepare -VirtualNetworkName $vnetname

#If you want to abort the opration
Move-AzureVirtualNetwork -Abort -VirtualNetworkName $vnetName


Move-AzureVirtualNetwork -Commit -VirtualNetworkName $vnetname

If you getting error as below.

Error: Virtual network "Vnet Name" not found. Either it does not exist or it is an Azure Resource Manager resource, which cannot be used with Cloud Services.


This can happen if you created the Virtual Network in the new Azure portal. The actual Virtual Network name follows the pattern "Group * "

Find the below name.. Vnet Actual name if you see it will be srv-w3 but it gives error, so click on it and check vnet site name.. 
 


No comments:

Post a Comment

Get SSL Certificate Expiry Notification on Mail.

 There are multiple ways to get SSL Certification expiry details/alert. We all know if our SSL certificate get expire, how critical situatio...