Configure Azure VPN Client – Microsoft Entra ID authentication – Linux (Preview)

This article helps you configure the Azure VPN Client on a Linux computer (Ubuntu) to connect to a virtual network using a VPN Gateway point-to-site (P2S) VPN and Microsoft Entra ID authentication. For more information about point-to-site connections, see About Point-to-Site connections.

The steps in this article apply to Microsoft Entra ID authentication using the Microsoft-registered Azure VPN Client app with associated App ID and Audience values. This article doesn't apply to the older, manually registered Azure VPN Client app for your tenant. For more information, see About point-to-site VPN - Microsoft Entra ID authentication.

While it's possible that the Azure VPN Client for Linux might work on other Linux distributions and releases, the Azure VPN Client for Linux is only supported on the following releases:

  • Ubuntu 20.04
  • Ubuntu 22.04

Prerequisites

Complete the steps for the point-to-site server configuration. See Configure a P2S VPN gateway for Microsoft Entra ID authentication.

Workflow

After your Azure VPN Gateway P2S server configuration is complete, your next steps are as follows:

  1. Download and install the Azure VPN Client for Linux.
  2. Import the client profile settings to the VPN client.
  3. Create a connection.

Download and install the Azure VPN Client

Use the following steps to download and install the latest version of the Azure VPN Client for Linux.

Note

Add only the repository list of your Ubuntu version 20.04 or 22.04. For more information, see the Linux Software Repository for Microsoft Products.

# install curl utility
sudo apt-get install curl

# Install Microsoft's public key
curl -sSl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc

# Install the production repo list for focal
# For Ubuntu 20.04
curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft-
ubuntu-focal-prod.list

# Install the production repo list for jammy
# For Ubuntu 22.04
curl https://packages.microsoft.com/config/ubuntu/22.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft-
ubuntu-jammy-prod.list

sudo apt-get update
sudo apt-get install microsoft-azurevpnclient

Extract the VPN client profile configuration package

To configure your Azure VPN Client profile, you download a VPN Client profile configuration package from the Azure P2S gateway. This package contains the necessary settings to configure the VPN client.

If you used the P2S server configuration steps as mentioned in the Prerequisites section, you've already generated and downloaded the VPN client profile configuration package that contains the VPN profile configuration files you'll need. If you need to generate configuration files, see Download the VPN client profile configuration package.

If your P2S gateway configuration was previously configured to use the older, manually registered App ID versions, your P2S configuration doesn't support the Linux VPN client. See About the Microsoft-registered App ID for Azure VPN Client.

Locate and extract the zip file that contains the VPN client profile configuration package. The zip file contains the AzureVPN folder. In the AzureVPN folder, you'll see either the azurevpnconfig_aad.xml file, or the azurevpnconfig.xml file, depending on whether your P2S configuration includes multiple authentication types. The .xml file contains the settings you use to configure the VPN client profile.

Modify profile configuration files

If your P2S configuration uses a custom audience with your Microsoft-registered App ID, you might receive error message AADSTS650057 when you try to connect. Retrying authentication usually resolves the issue. This happens because the VPN client profile needs both the custom audience ID and the Microsoft application ID. To prevent this, modify your profile configuration .xml file to include both the custom application ID and the Microsoft application ID.

Note

This step is necessary for P2S gateway configurations that use a custom audience value and your registered app is associated with the Microsoft-registered Azure VPN Client app ID. If this doesn't apply to your P2S gateway configuration, you can skip this step.

  1. To modify the Azure VPN Client configuration .xml file, open the file using a text editor such as Notepad.

  2. Next, add the value for applicationid and save your changes. The following example shows the application ID value for c632b3df-fb67-4d84-bdcf-b95ad541b5c8.

    Example

    <aad>
       <audience>{customAudienceID}</audience>
       <issuer>https://sts.windows.net/{tenant ID value}/</issuer>
       <tenant>https://login.microsoftonline.com/{tenant ID value}/</tenant>
       <applicationid>c632b3df-fb67-4d84-bdcf-b95ad541b5c8</applicationid> 
    </aad>
    

Import client profile configuration settings

In this section, you configure the Azure VPN client for Linux.

  1. On the Azure VPN Client page, select Import.

    Screenshot of Azure VPN Client import selection.

  2. Select Import Profile and browse to find the profile xml file. Select the file. With the file selected, select OK.

    Screenshot of Azure VPN Client showing the file to be imported.

  3. View the connection profile information. Change the Certificate Information value to show the default DigiCert_Global_Root G2.pem or DigiCert_Global_Root_CA.pem. Don't leave blank.

  4. If your VPN client profile contains multiple client authentications, for Client Authentication, Authentication Type select the option for Microsoft Entra ID.

    Screenshot Server Validation and Client Authentication fields.

  5. For the Tenant field, specify the URL of your Microsoft Entra Tenant. Make sure the Tenant URL doesn't have a \ (backslash) at the end. Forward slash is permissible.

    The Tenant ID has the following structure: https://login.microsoftonline.com/{Entra TenantID}

  6. For the Audience field, specify the Application ID (App ID).

    The App ID for Azure Public is: c632b3df-fb67-4d84-bdcf-b95ad541b5c8. We also support custom App ID for this field.

  7. For the Issuer field, specify the URL of the Secure Token Service. Include a trailing slash at the end of the Issuer value. Otherwise, the connection might fail.

    Example: https://sts.windows.net/{AzureAD TenantID}/

  8. When the fields are filled in, click Save.

  9. In the VPN Connections pane, select the connection profile that you saved. Then, from the dropdown, click Connect.

    Screenshot showing the connection profile and the area to find connect in the dropdown.

  10. The web browser automatically appears. Fill in the username/password credentials for Microsoft Entra ID authentication, then connect.

    Screenshot of authentication credential sign in page.

  11. If the connection is completed successfully, the client shows a green icon and the Status Logs window shows Status = Connected.

    Screenshot of the vpn client with the status logs window showing connected.

  12. Once connected, the status changes to Connected. To disconnect from the session, from the dropdown, select Disconnect.

Delete a VPN client profile

  1. On the Azure VPN client, select the connection you want to remove. Then, from the dropdown, select Remove.

    Screenshot of the vpn client with the dropdown showing three options: Connect, Configure, Remove.

  2. On Remove VPN Connection?, select OK.

    Screenshot of the vpn client with the Remove VPN Connection popup open.

Check logs

To diagnose issues, you can use the Azure VPN Client Logs.

  1. In the Azure VPN Client, go to Settings. In the right pane, select Show Logs Directory.

    Screenshot of the vpn client showing the Show logs directory option.

  2. To access the log file, go to the /var/log/azurevpnclient folder and locate the AzureVPNClient.log file.

    Screenshot of the location of the Azure VPN Client log file.

Next steps