Share via

Certificate issue with 'Enter-AzVM' command in Cloud Shell

Wootery 1 Reputation point
2021-05-29T17:34:21.13+00:00

I was not able to access my Windows Server VM from Cloud Shell, on account of a certificate error.
I'm following this documentation: https://learn.microsoft.com/en-us/azure/cloud-shell/quickstart-powershell#interactively-log-on-to-a-remote-vm

My instance is named 'mb2'. I was hoping to run:

Enable-AzVMPSRemoting -Name mb2 -ResourceGroupName mb2_group

cd 'Azure:/Free Trial/ResourceGroups/mb2_group/Microsoft.Compute/virtualMachines'

Get-Item mb2 | Enter-AzVM -Credential (Get-Credential)

But the final command fails:

PS Azure:\> Get-Item mb2 | Enter-AzVM -Credential (Get-Credential)

PowerShell credential request
Enter your credentials.
User: mb
Password for user mb: *******

Enter-PSSession: /usr/local/share/powershell/Modules/PSCloudShellUtility/PSCloudShellUtility.psm1:958
Line |
958 | Enter-PSSession -ComputerName $cName -Credential $Credential …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Connecting to remote server 51.105.36.33 failed with the following error message : error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed For more
| information, see the about_Remote_Troubleshooting Help topic.

Azure:/Free Trial/ResourceGroups/mb2_group/Microsoft.Compute/virtualMachines
PS Azure:\>

It appears that the 'Enter-AzVM' command is failing on account of not knowing my VM's thumbprint.

I'm able to connect to the VM from my local machine using RDP (blindly accepting the reported thumbprint).

A chat session with Azure support was not able to resolve the issue.

Azure Virtual Machines
Azure Virtual Machines

An Azure service that is used to provision Windows and Linux virtual machines.

Windows for business | Windows Server | User experience | PowerShell

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.