Restore SSH password for VM with #sitecore #xdb in Azure

CONTEXT

It is not always possible to find enough time to play with your free-time projects and sometimes it might take more than a week after you created environment and you started using it. And during this week you could forget something, e.g. password for you SSH connection 🙂

This is exactly what happened to me this weekend when I returned to my Sitecore development VMs with xDB and SOLR in Azure. Fortunately, I was able to find solution.

SOLUTION

First of all, you would need to install Azure CLI and connect to your subscribtion. Now you should follow steps below.

Reset Password

Step 1: Create a file named PrivateConf.json with these contents, substituting for the placeholder values.

{
"username":"your login",
"password":"your password",
"expiration":"2020-01-01"
}

Step 2: Run this command, substituting the name of your virtual machine for “vmname“.

> azure vm extension set vmname VMAccessForLinux Microsoft.OSTCExtensions 1.2 --private-config-path PrivateConf.json

Azure more

If you are using new portal or creates VM instance from MongoDB template. Method above might not work for you, as it won’t be able to find your virtual machines.
To reset password in this case you would need to switch to Resource Manager module:

> azure config mode arm

Also, format of the command would be slightly different, as you would need to add resource group to configuration:

> azure vm extension set vmgroup vmname VMAccessForLinux Microsoft.OSTCExtensions 1.2 --private-config-path PrivateConf.json

PORTAL.AZURE.COM

In previous version of Azure management console if was also possible to do this operations online, but it would not should you anything created with Resource module.
On the other hand, you could view your resources in preview mode of new portal,
but management of extensions required for this operation is “coming soon”.Azure Extensions - Coming Soon


Follow me on twitter @true_shoorik & I hope this helps.

Restore SSH password for VM with #sitecore #xdb in Azure

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s