Not able to connect through Rasdial in azure ARM VPN connection -


i not able connect vpn using powershell cmdlet. use 'rasdial' build agent connect vpn, can trigger automated tests. whole process automated.

earlier same rasdial command - rasdial "vpnname" working fine classic model (asm) of vpn. but, after migrated arm, facing issue. through ui i.e. clicking on buttons connect vpn working fine our need connect through script.

i getting message-

this function not supported on system.

nb: following post- https://dzone.com/articles/deconstructing-azure-point

the same workaround worked in asm not woking in arm. can workaround or fix ?

i using below script create , download vpn package. not sure missing in script causing issue-

$vnetname  = "myvpn" $subname = "subnet-1" $gwsubname = "gatewaysubnet" $vnetprefix1 = "15.3.0.0/16" $subprefix = "15.3.1.0/24" $gwsubprefix = "15.3.200.0/26" $vpnclientaddresspool = "158.17.201.0/24" $rg = "vmsrg" $location = "west europe" $dns = "15.3.0.0" $gwname = "gateway" $gwipname = "gatewayip" $gwipconfname = "gatewayipconfig" $p2srootcertname = "xxxxx.cer" $deployusername = "atf@hotmail.com" $deployuserpassword = "xxxxx"   $azurepwd = convertto-securestring $deployuserpassword -asplaintext -force $azurecredential = new-object -typename system.management.automation.pscredential -argumentlist $deployusername, $azurepwd  add-azurermaccount -credential $azurecredential -subscriptionname development  new-azurermresourcegroup -name $rg -location $location $fesub = new-azurermvirtualnetworksubnetconfig -name $subname -addressprefix $subprefix $gwsub = new-azurermvirtualnetworksubnetconfig -name $gwsubname -addressprefix $gwsubprefix new-azurermvirtualnetwork -name $vnetname -resourcegroupname $rg -location $location -addressprefix $vnetprefix1 -subnet $fesub, $gwsub -dnsserver $dns  $vnet = get-azurermvirtualnetwork -name $vnetname -resourcegroupname $rg $subnet = get-azurermvirtualnetworksubnetconfig -name "gatewaysubnet" -virtualnetwork $vnet  $pip = new-azurermpublicipaddress -name $gwipname -resourcegroupname $rg -location $location -allocationmethod dynamic  $ipconf = new-azurermvirtualnetworkgatewayipconfig -name $gwipconfname -subnet $subnet -publicipaddress $pip  $myp2srootcertpubkeybase64 = "xxxxx" $p2srootcert = new-azurermvpnclientrootcertificate -name "p2svnetrootcertname" -publiccertdata $myp2srootcertpubkeybase64 new-azurermvirtualnetworkgateway -name $gwname -resourcegroupname $rg -location $location -ipconfigurations $ipconf -gatewaytype vpn -vpntype routebased -enablebgp $false -gatewaysku standard -vpnclientaddresspool $vpnclientaddresspool -vpnclientrootcertificates $p2srootcert get-azurermvpnclientpackage -resourcegroupname $rg -virtualnetworkgatewayname $gwname -processorarchitecture amd64 

as able connect using gui. hope script doing it's job.

your powershell script seems fine (i didn't try login , resource group pieces, else works $fesub on.) except third line bottom. -name tag have "p2svnetrootcertname" needs same $p2srootcertname. more information, refer azure documentation: https://azure.microsoft.com/en-us/documentation/articles/vpn-gateway-howto-point-to-site-rm-ps/

as rasdial, stackoverflow post has answered this: azure virtual network point-to-site (ex. azure connect) autoconnect

-bridget [msft]


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -