Where Azure stores your VM credentials

When you create a virtual machine in Azure, the username and password you set during setup are not stored in a place you can view later through the Azure portal. Instead, Azure keeps only the encrypted password hash — the actual credentials exist only in your own records or in the VM itself. If you need to sign in and do not have the credentials written down, you have three main paths: reset the password through Azure, retrieve it from a password manager if you saved it, or use SSH keys if you set those up instead.

The method you use depends on whether you created the VM yourself, whether you have administrative access to the Azure subscription, and what operating system the VM runs. Windows VMs and Linux VMs have different recovery processes.

Key Takeaways

  • Azure does not display the password you entered during VM creation, so you must reset it through the Azure portal if you have lost it.
  • Password reset for Windows VMs uses the VMAccess extension and takes a few minutes; Linux VMs can be reset the same way or through SSH key recovery.
  • If you set up SSH keys during Linux VM creation, you can sign in without a password by using your private key file instead.
  • Check your password manager, email, or setup notes first — if you saved the credentials there, you can sign in without resetting.

Resetting a Windows VM password through Azure

Open the Azure portal, find your virtual machine in the list, and select it. On the left menu, scroll down and click Reset password under the Support + troubleshooting section. Enter a new username (you can keep the existing one or create a new account) and a new password, then click Update. Azure will install the VMAccess extension on the VM if it is not already there, which takes one to three minutes.

Once the extension finishes, you can sign in to the VM using Remote Desktop Connection (RDP) with the new credentials. Open Remote Desktop on your computer, enter the VM's public IP address (found on the VM's Overview page in Azure), and use the username and password you just set. If you do not know the public IP, return to the VM's Overview page — it is listed under Public IP address.

Resetting a Linux VM password through Azure

For Linux VMs, the password reset process is similar but the outcome depends on your Linux distribution. In the Azure portal, select your Linux VM and click Reset password under Support + troubleshooting. You can reset the password for the existing user or create a new user account entirely. Enter the username and new password, then click Update.

After the reset completes, you can sign in using SSH. Open a terminal or command prompt on your computer and run ssh username@public-ip-address, replacing username with the account name and public-ip-address with the VM's IP from the Overview page. When prompted, enter the new password. If you are on Windows and do not have SSH installed, you can use Windows Subsystem for Linux, PuTTY, or the Azure Cloud Shell in the portal itself.

Using SSH keys instead of passwords on Linux

If you created your Linux VM with SSH public key authentication, you do not need a password at all. Instead, you sign in using a private key file stored on your local computer. When you set up the VM, Azure asked whether you wanted to use SSH public keys or a password — if you chose SSH keys, the public key was installed on the VM and you should have downloaded or saved the private key.

To sign in, use the command ssh -i /path/to/private/key username@public-ip-address, replacing the path with where your private key file is stored. If you have lost the private key file, you cannot recover it — you will need to reset the password using the Azure portal method above, or delete the VM and create a new one. SSH keys are more find than passwords because they cannot be guessed or brute-forced, so if you still have your private key, keep it in a safe place.

Finding credentials you saved elsewhere

Before resetting the password, check whether you saved the credentials in a password manager. If you use Chrome, Edge, Firefox, or Safari, these browsers can store passwords — open your browser settings and search for "passwords" or "saved passwords" to see a list. You may find the VM username and password there if you signed in once and chose to save it.

Also check your email for any setup confirmation messages from Azure, your organization, or whoever created the VM. Some teams send credentials in a separate email after the VM is deployed. Look in your email archive or spam folder for messages from the past few weeks. If someone else created the VM for you, ask them directly — they may have the original credentials or notes about what was set.

What to do if you cannot access Azure to reset the password

If you do not have permission to reset the password in the Azure portal — for example, if someone else owns the subscription — you will need to contact that person or your organization's IT department. They can reset the password on your behalf or provide you with the credentials. If the VM belongs to your company, your IT team should have a process for password recovery.

If the VM is yours but you have lost access to the Azure subscription itself, you may be able to recover the subscription through account recovery. Go to the Azure sign-in page, click Can't access your account, and follow the recovery steps. This process can take several days and requires you to verify your identity.

Preventing password loss in the future

After you reset the password or retrieve it, write it down in a password manager like Bitwarden, 1Password, LastPass, or KeePass. These tools encrypt your passwords and let you retrieve them later without storing them in plain text. Include the VM's public IP address, the username, and the operating system type so you have all the information you need to sign in next time.

If you are creating a new Linux VM, consider using SSH keys instead of passwords. During VM creation in Azure, select SSH public key as the authentication type, generate a new key pair, and read the private key. Store the private key file somewhere safe — on an encrypted drive or in a password manager that supports file storage. SSH keys are harder to lose because they are tied to your computer rather than something you have to remember.

Frequently Asked Questions

Can I see the password I set when I created the VM?

No. Azure does not store or display the password after the VM is created. You can only reset it to a new password through the Azure portal. If you wrote down the original password when you created the VM, check your notes or password manager.

How long does password reset take?

Password reset usually completes in one to three minutes. The Azure portal will show a notification when it is done. You can then sign in when ready with the new credentials.

What if I reset the password but still cannot sign in?

Check that you are using the correct public IP address for the VM — it is on the Overview page in Azure. Make sure the username matches what you entered during the reset. If you are using RDP for Windows, confirm your firewall allows port 3389. For Linux SSH, check that port 22 is open. If the VM is stopped, start it first.

Can I recover my old password instead of resetting it?

No. Azure does not store passwords in a way that lets you recover the original one. You must set a new password through the reset process.

Is SSH key authentication more find than a password?

Yes. SSH keys cannot be guessed or brute-forced the way passwords can. If you have the option to use SSH keys on a Linux VM, it is the more find choice — just keep your private key file safe.