Azure VPN Client - Is there a way to reconnect automatically when connection is lost?

Hello,

I’m using Azure VPN Client app (latest version from Microsoft Store) on Windows 11 that’s already fully configured and working.

Once in a while, there might be some connection drop due to spotty internet or other reasons.

That requires to go back to the app and click “connect” so it reconnects.

Is there a setting or a way to automate this, so it keeps trying to reconnect if connections is being dropped?

I found this article that says “Set your Azure VPN connections to “Connect Automatically” with PowerShell”

https://powers-hell.com/2020/11/28/set-your-azure-vpn-connections-to-connect-automatically-with-powershell/

But I’m a little lost on how the “Retry reconnect” is being accomplished using powershell and/or Intune? Can you just do with Powershell or Task scheduler or command line to tell it to reconnect if it lost connection?

Someone also commented on the app review section and got a response from Microsoft:

Works well - just needs some extra features
Seems to work well, especially after the last update. To deploy this as an Enterprise solution it needs a few extra features. I'm looking to be able to configure/manage it via
Intune/Config Mgr or PowerShell etc. I like that I can now import the profile from the command line and that I can add routes and DNS suffixes to the profile XML file. What I'm still looking
for is the ability to configure automatic connection programmatically and Network Location Awareness so it doesn't try to connect when a device is connected to the cooperate network.
Pete 3 years ago
=======Response from Microsoft Corporation======
Thank you for your feedback, we are glad that you like the product. You can deploy a store app using Intune and then import the profile using a command-line script. https://docs.microsoft.com/en-us/azure/vpn-gateway/openvpn-azure-ad-client#can-i-imprt-the-profile-from-a-command-line-prompt%20. . We are evaluating the Network Location Awareness
request. Please check https://azure.microsoft.com/en-us/blog/topics/announcements/ for any updates

The author from the article above also mentioned: "

The key to this solution is found in the registry (as always). The auto connection settings can be found in the local machine hive path shown below.

HKLM:\SYSTEM\CurrentControlSet\Services\RasMan\Config"

But when I go there, I don’t see the setting AutoTriggerDisabledProfileList or any other from his screenshots, so it’s not clear if I’m supposed to add them manually or they’re supposed to appear there?

I also found this article about this registry setting:

https://msendpointmgr.com/2020/04/29/keeping-always-on-vpn-always-on/

But this has something to do with another program called Always On VPN?

Would appreciate if you have any suggestions or advice.

Thank you.

Solution: Under Windows 11 settings go to VPN & Internet - Find the Azure VPN Client name, click on it to expand, click on Connect Automatically, and that’s it :slight_smile:

Do you have a screenshot of the setting? Under VPN im only seeing the option to build a new VPN profile, not use the ones already selected. Im on Windows 11 22H2

It appears that this only works if the VPN has been added through the .ps1 script that is provided.

This is atleast the case for the Azure VPN Gateway Basic

I also do not see this option.

OS Name Microsoft Windows 11 Business

Version 10.0.22621 Build 22621

thanks so much, this worked for me. was thinking basic SKU wouldn’t work but it does