I cannot login to my Azure Virtual Machine

Leotrim Ramadani 0 Reputation points
2023-03-13T00:27:42.7033333+00:00

Hi everyone,

I have recently started working with Azure cloud development and I am stucked with Azure Virtual Desktop.

I have created two virtual machines, both are available, running, with public and private ip adresses, both have Virtual Network assigned, no error shown anywhere... but when I try to login using their public IP address, it says "Failed login attempt". I want to change the password of the admin user for that machine but it says "Deploy failed with deploymentStatusCode (Failure)". So I don't know whether I am missing something with one of my components or I don't know...

Here's a photo of one of my VM's:
Screenshot_17

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

2 answers

Sort by: Most helpful
  1. vipullag-MSFT 24,441 Reputation points
    2023-03-13T04:47:38.81+00:00

    Hello Leotrim Ramadani

    Welcome to Microsoft Q&A Platform, thanks for posting your query here.

    You can change the administrative username and password for a Windows Azure Virtual Machine by using the VMAccess extension. You can use the Set-AzVMAccessExtension command in PowerShell to reset the administrative password of a Windows VM to a temporary password. Sample commands below for your reference. After you run this code, you should reset the password at first login.

    $cred=Get-Credential
    Set-AzVMAccessExtension -ResourceGroupName "myResourceGroup" -VMName "myVM" -Name "myVMAccess" -Location WestUS -UserName $cred.GetNetworkCredential().Username -Password $cred.GetNetworkCredential().Password -typeHandlerVersion "2.0"

    If you don't have VMAccess extension on your VM, you can add it through Azure Portal.

    Select the VM in the portal, select Extensions, and then select Add. Choose the VMAccess extension from the list of available extensions, and follow the instructions in the wizard.
    Ref: https://learn.microsoft.com/en-us/azure/virtual-machines/extensions/features-windows

    From Azure Portal, you can try a reset of password:

    1. Go to the Azure portal and navigate to your Virtual Machine.
    2. Click on the "Extensions" button in the left-hand menu.
    3. Click on the "Add" button and then select "VM Access" from the list of available extensions.
    4. In the "VM Access" blade, select the appropriate subscription and resource group, and then select the Virtual Machine for which you want to reset the password.
    5. Enter a new username and password for the admin account, and then click on the "Ok" button.
    6. Once the extension is installed, connect to the Virtual Machine using RDP and enter the new admin username and password.

    Hope this helps.

    If you need further help on this, tag me in a comment.

    If the suggested response helped you resolve your issue, please 'Accept as answer', so that it can help others in the community looking for help on similar topics.

    0 comments No comments

  2. T. Kujala 8,706 Reputation points
    2023-03-13T04:57:07.4333333+00:00

    Hi @Leotrim Ramadani

    You could do the following:

    Check the firewall settings: Make sure that the firewall settings are properly configured to allow inbound traffic on the required ports for your Virtual Machine. You can check the Network Security Group settings in the Azure portal.

    You can try change password by using the PS command.

    Set-AzVMAccessExtension -ResourceGroupName <resource-group-name> -VMName <vm-name> -Name <extension-name> -UserName <admin-username> -Password <new-password>

    0 comments No comments