Hello Xu,
Thank you for posting question on Microsoft Windows Forum.
Based on the provided error message when creating an Azure AD–joined machine in Azure. This probably indicates that a network appliance (like a firewall, proxy, or web filter) is intercepting the encrypted traffic between your Azure VM and Microsoft's enrollment servers.
Since Intune enrollment uses certificate pinning (strict validation of the server's certificate), it might detect this interception as a "Man-in-the-Middle" attack and drops the connection, resulting in the "This connection isn’t secure" error.
If your Azure VM sits behind a firewall (like Azure Firewall, Palo Alto, Zscaler, or a corporate proxy), that appliance is likely trying to inspect the encrypted traffic and Intune does not support SSL inspection. To test this theory. If you can temporarily connect the VM to a network without restrictions, try the enrollment again. If it works, the firewall might be the culprit. If possible! checking with your network team about SSL inspection as that is the specific trigger for the error in this context.
It is also worth of checking the date and time. If the VM's clock is out of sync with the actual time by more than a few minutes, the SSL handshake will fail because the security certificates will appear invalid. Right-click the time in the system tray and select Adjust date/time. Click Sync now. Retry the enrollment in Company Portal.
Last point to mention here is to check the missing Intune license. If the user account signing in does not have an Intune license, enrollment fails. Azure AD join attempts to automatically enroll in Intune MDM, but without a license, the process breaks. Ensure the user account has a valid Microsoft Intune license assigned by checking in Microsoft 365 Admin Center → Users → Licenses. Otherwise, try enrolling with a different user who has Intune licensing to confirm if the issue is account-specific.
You can consult the following article for more information regarding your concerns.
- https://learn.microsoft.com/en-us/troubleshoot/mem/intune/device-enrollment/troubleshoot-windows-enrollment-errors
- https://techcommunity.microsoft.com/blog/intunecustomersuccess/support-tip-aligning-network-policy-with-microsoft-intune-and-zero-trust/4466688
Hope the above information is helpful! If it is. Free feel to hit "Accepted" for benefitting others in community having the same issue too.