Install the password reset extension on VMs for your Azure Stack Edge Pro GPU device

APPLIES TO: Yes for Pro GPU SKUAzure Stack Edge Pro - GPUYes for Pro 2 SKUAzure Stack Edge Pro 2Yes for Pro R SKUAzure Stack Edge Pro RYes for Mini R SKUAzure Stack Edge Mini R                  

This article covers steps to install, verify, and remove the password reset extension using Azure Resource Manager templates on both Windows and Linux VMs.

Prerequisites

Before you install the password reset extension on the VMs running on your device:

  1. Make sure to have access to an Azure Stack Edge device on which you've deployed one or more VMs. For more information, see Deploy VMs on your Azure Stack Edge Pro GPU device via the Azure portal.

    Here's an example where Port 2 was used to enable the compute network. If Kubernetes isn't deployed on your environment, you can skip the Kubernetes node IP and external service IP assignment.

    Screenshot of the Advanced networking pane for an Azure Stack Edge device. Network settings for Port 2 are highlighted.

  2. Download the templates to your client machine. Unzip the files into a directory you’ll use as a working directory.

  3. Verify that the client you'll use to access your device is connected to the local Azure Resource Manager over Azure PowerShell. For detailed instructions, see Connect to Azure Resource Manager on your Azure Stack Edge device.

    The connection to Azure Resource Manager expires every 1.5 hours or if your Azure Stack Edge device restarts. If your connection expires, any cmdlets that you execute will return error messages to the effect that you aren't connected to Azure. In this case, sign in again.

Edit parameters file

Depending on the operating system for your VM, you can install the extension for Windows or for Linux. You'll find the parameter and template files in the PasswordResetExtension folder.

To change the password for an existing VM, edit the addPasswordResetExtensionTemplate.parameters.json parameters file and then deploy the template addPasswordResetExtensionTemplate.json.

The file addPasswordResetExtensionTemplate.parameters.json takes the following parameters:

{ 
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", 
  "contentVersion": "1.0.0.0", 
  "parameters": { 
      "vmName": { 
          "value": "<Name of the VM>" 
      }, 
      "extensionType": { 
          "value": "<OS type of the VM, for example, Linux or Windows>" 
      }, 
      "username": { 
          "value": "<Existing username for connecting to your VM>" 
      }, 
      "Password": { 
          "value": "<New password for the user>" 
      } 
  } 
} 

Deploy template

Set some parameters. Run the following command:

$templateFile = "<Path to addPasswordResetExtensionTemplate.json file>" 
$templateParameterFile = "<Path to addPasswordResetExtensionTemplate.parameters.json file>" 
$RGName = "<Name of resource group>" 
New-AzResourceGroupDeployment -ResourceGroupName $RGName -TemplateFile $templateFile -TemplateParameterFile $templateParameterFile -Name "<Deployment name>" -AsJob

The extension deployment is a long running job and takes about 10 minutes to complete.

Here's a sample output:

PS C:\WINDOWS\system32> $templateFile = "C:\PasswordResetVmExtensionTemplates\addPasswordResetExtensionTemplate.json" 
PS C:\WINDOWS\system32> $templateParameterFile = "C:\PasswordResetVmExtensionTemplates\addPasswordResetExtensionTemplate.parameters.json" 
PS C:\WINDOWS\system32> $RGName = "myasepro2rg" 
PS C:\WINDOWS\system32> New-AzResourceGroupDeployment -ResourceGroupName $RGName -TemplateFile $templateFile -TemplateParameterFile $templateParameterFile -Name "windowsvmdeploy" -AsJob
Id     Name            PSJobTypeName   State         HasMoreData     Location             Command 
--     ----            -------------   -----         -----------     --------             ------- 
9      Long Running... AzureLongRun... Running       True            localhost            New-AzResourceGro... 
 
PS C:\WINDOWS\system32>

Track deployment

To check the deployment status of extensions for a given VM, run the following command:

Get-AzVMExtension -ResourceGroupName <MyResourceGroup> -VMName <MyWindowsVM> -Name <Name of the extension>

Here's a sample output:

PS C:\WINDOWS\system32> 
Get-AzVMExtension -ResourceGroupName myasepro2rg -VMName mywindowsvm -Name windowsVMAccessExt 
 
ResourceGroupName       : myasepro2rg 
VMName                  : mywindowsvm 
Name                    : windowsVMAccessExt 
Location                : dbelocal 
Etag                    : null 
Publisher               : Microsoft.Compute 
ExtensionType           : VMAccessAgent 
TypeHandlerVersion      : 2.4 
Id                      : /subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourceGroups/myasepro2rg/provi 
                          ders/Microsoft.Compute/virtualMachines/mywindowsvm/extensions/windowsVMAccessExt 
PublicSettings          : { 
                            "username": "azureuser" 
                          } 
ProtectedSettings       : 
ProvisioningState       : Succeeded 
Statuses                : 
SubStatuses             : 
AutoUpgradeMinorVersion : True 
ForceUpdateTag          : 
  
PS C:\WINDOWS\system32>

You can see below that the extension has been installed successfully.

Screenshot of the VM details pane with call-outs for the network interface and installed extensions on Windows.

Verify the updated VM password

To verify the VM password update, connect to the VM using the new password. For detailed instructions, see Connect to a Windows VM.

Screenshot of the Remote Desktop Connection dialog to connect to a VM.

Remove the extension

To remove the password reset extension, run the following command:

Remove-AzVMExtension -ResourceGroupName <Resource group name> -VMName <VM name> -Name <Name of the extension>

Here's a sample output:

PS C:\WINDOWS\system32> Remove-AzVMExtension -ResourceGroupName myasepro2rg -VMName mywindowsvm5 -Name windowsVMAccessExt 
  
Virtual machine extension removal operation 
This cmdlet will remove the specified virtual machine extension. Do you want to continue? 
[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"): Yes 
  
RequestId IsSuccessStatusCode StatusCode ReasonPhrase 
--------- ------------------- ---------- ------------ 
          True                OK         OK 
  
PS C:\WINDOWS\system32>

Next steps

Learn how to: