An Azure service that enables the connection of on-premises networks to Azure through site-to-site virtual private networks.
Welcome to Microsoft Q&A.
I hope you are doing well @Maciej Kurzeja
Yes, CertificateGroupId is supported for certificate-based P2S authentication, and Microsoft documents that the certificate-based multiple address pool selection is performed using the Subject/Common Name (CN) of the client certificate.
The important detail in your configuration is this:
Certificate CN = <devicename>.contoso.com
while your:
CertificateGroupId = contoso.com
Microsoft's documentation states that the CertificateGroupId value is based on the certificate's Common Name (CN). It also specifically notes that the multiple address pool selection does not use the SAN for matching. If a SAN is present, Microsoft recommends that it match the Subject value.
Therefore, I would first test the configuration with the CertificateGroupId matching the actual certificate Subject/CN value.
For example, if the machine certificate is:
Subject: CN=PC001.contoso.com
configure the policy member with:
CertificateGroupId = PC001.contoso.com
If your intention is to place multiple machines into the same address pool, you would need a certificate naming scheme that allows the same CN/group value to be used for those certificates, rather than relying on the DNS suffix alone.
You can verify the certificate on the Windows device with:
Get-ChildItem Cert:\LocalMachine\My |
Select-Object Subject, DnsNameList, EnhancedKeyUsageList
Also check the certificate directly in certlm.msc and look under Details → Subject to confirm the exact CN value.
Regarding machine certificates / Device Tunnel
The Microsoft documentation describes the matching mechanism as certificate Subject/CN and does not state that CertificateGroupId is limited to user certificates. Therefore, I would not treat the fact that this is an Always On VPN Device Tunnel as the primary issue.
The first thing I would validate is whether the CertificateGroupId exactly matches the Subject/CN being presented by the machine certificate.
Microsoft also explicitly states that the multiple address pool selection does not work with SAN-based matching. https://learn.microsoft.com/en-us/azure/vpn-gateway/point-to-site-user-groups-create-portal
Microsoft documentation
- Assign Users IP Addresses from Defined Pools for P2S VPN Connections https://learn.microsoft.com/en-us/azure/vpn-gateway/point-to-site-user-groups-create-portal
- Assign Users IP Addresses from Defined Pools for P2S VPN Connections – PowerShell https://learn.microsoft.com/en-us/azure/vpn-gateway/point-to-site-user-groups-create
- About Azure Point-to-Site VPN connections https://learn.microsoft.com/en-us/azure/vpn-gateway/point-to-site-about
Based on the configuration you provided, I would start by changing/testing the CertificateGroupId against the exact CN of the machine certificate rather than contoso.com. If that works, it confirms that the issue is the group matching value rather than the Device Tunnel itself.
If this answer helped clarify the platform capabilities and save you troubleshooting time, please consider marking it as Accepted. This helps others in the community find similar solutions.