how to check if no issue on Azure VMs starting automatically

Testa 551 Reputation points
2022-08-31T05:16:06.313+00:00

Hello,

Planning to start VM automatically using logic apps. I already tried without any issue.
But how do I check automatically if Azure VM can be accessible or not?

What I mean by that is I sometimes cannot access to VMs using RDP, even though they are running.
After restarting VMs, I can access to VMs with RDP.

So, I would like to know how to check VM accessibility in an automated way after starting VM with logic apps.
(if not accessible, I would like to make VMs restart)

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,057 questions
0 comments No comments
{count} votes

Accepted answer
  1. Andreas Baumgarten 94,711 Reputation points MVP
    2022-08-31T06:32:56.177+00:00

    Hi @Testa ,

    maybe a simple PowerShell script helps:

    $testConnection = Test-NetConnection -ComputerName <Your VM Name> -Port 3389  
    if ($testConnection.TcpTestSucceeded) {  
        Write-Output "Looks good"   
    }  
    else {  
        Write-Output "Unable to reach the VM on TCP port 3389"  
    }   
    

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful