# Azure VM User Accounts

<figure><img src="https://762006384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJXOXEifAmpyvNVL1to%2Fuploads%2FXLaNrWtCYY05sHMTOxNR%2FAzure%20VM%20User%20Accounts.jpg?alt=media&#x26;token=e9db8f07-d941-4aea-9ae0-1c6ae9fed259" alt=""><figcaption></figcaption></figure>

## Overview

In this guide, you'll learn how to rotate Azure Virtual Machine local and remote user accounts within the Azure environment using KeeperPAM.

* See the [Azure Overview](https://docs.keeper.io/en/keeperpam/privileged-access-manager/password-rotation/rotation-use-cases/azure/azure-vm-user-accounts) for a high level overview and getting started with Azure

## Prerequisites

* [Rotation enforcements](https://docs.keeper.io/en/keeperpam/privileged-access-manager/getting-started/enforcement-policies) are configured for your role
* A Keeper Secrets Manager [application](https://docs.keeper.io/en/keeperpam/privileged-access-manager/getting-started/applications) has been created
* Your Azure environment is [configured](https://docs.keeper.io/en/keeperpam/privileged-access-manager/getting-started/pam-configuration/azure-environment-setup) per our documentation
* A Keeper Rotation [gateway](https://docs.keeper.io/en/keeperpam/privileged-access-manager/getting-started/gateways) is already installed
* The Gateway can communicate to the target Windows machine using [WinRM](https://docs.keeper.io/en/keeperpam/privileged-access-manager/references/setting-up-winrm) or [SSH](https://docs.keeper.io/en/keeperpam/privileged-access-manager/references/setting-up-ssh)
* `PowerShell` is available on all Windows machines and `bash` on all Linux targets

## 1. Set up PAM Machine Records

Keeper can rotate any local user account on either the Gateway machine or any other machine on the network. A PAM Machine record should be created for every machine. This PAM Machine record will be associated to a linked administrative credential that has the rights to change passwords for users on the machine.

Once a **PAM Machine** record is created for every machine, a **PAM User** record needs to be created for each user account that will be rotated.

The following table lists all the required fields that needs to be filled on the PAM Machine records.

<table><thead><tr><th width="253">Field</th><th>Description</th></tr></thead><tbody><tr><td><strong>Title</strong></td><td>Name of the Record e.g. <code>Windows Machine 1</code></td></tr><tr><td><strong>Hostname or IP Address</strong></td><td>Machine hostname or IP as accessed by the Gateway, e.g. 10.0.1.4</td></tr><tr><td><strong>Port</strong></td><td>Typically 5985 or 5986 for WinRM, 22 for SSH</td></tr><tr><td><strong>Private PEM Key</strong></td><td>Required for SSH if not using a password</td></tr><tr><td><strong>Operating System</strong></td><td>The VM Operating System: <code>Windows</code> or <code>Linux</code></td></tr><tr><td><strong>SSL Verification</strong></td><td>For WinRM, if selected, will use SSL mode port 5986. Ignored for SSH.</td></tr></tbody></table>

## 2. Set up PAM Configuration <a href="#managed-directory-services" id="managed-directory-services"></a>

Note: You can skip this step if you already have a PAM Configuration set up for this environment.

Make sure the following items are completed first:

* A Keeper Secrets Manager [application](https://docs.keeper.io/en/keeperpam/privileged-access-manager/getting-started/applications) has been created
* A Keeper Rotation [gateway](https://docs.keeper.io/en/keeperpam/privileged-access-manager/getting-started/gateways) is already installed, running, and is provisioned in the Keeper Secrets Manager application you created.
* PAM Machine records have been created for each target machine

If you are creating a new PAM Configuration, login to the Keeper Vault and select "Secrets Manager", then select the "PAM Configurations" tab, and click on "New Configuration".\
\
The following table lists all the required fields that needs to be filled on the **PAM Configuration**.

<table><thead><tr><th width="193">Field</th><th>Description</th><th data-hidden></th></tr></thead><tbody><tr><td><strong>Title</strong></td><td>Configuration name, example: <code>Azure Demo</code></td><td></td></tr><tr><td><strong>Environment</strong></td><td>Select: <code>Azure Network</code></td><td></td></tr><tr><td><strong>Gateway</strong></td><td>Select the Gateway that is configured on the Keeper Secrets Manager application and has network access to the machine configured from step 1</td><td></td></tr><tr><td><strong>Application Folder</strong></td><td>Select the Shared folder where the PAM Configuration will be stored. We recommend placing this in a shared folder with the admin accounts, not the machines.</td><td></td></tr><tr><td><strong>Azure ID</strong></td><td>A unique ID for this instance of Azure. This is for your reference and can be anything, but its recommended to be kept short<br>Ex: <code>Azure-prod</code></td><td></td></tr><tr><td><strong>Client ID</strong></td><td>The unique Application (client) ID assigned to your app by Azure AD when the application was registered.</td><td></td></tr><tr><td><strong>Client Secret</strong></td><td>The client credentials secret for the Azure application.</td><td></td></tr><tr><td><strong>Subscription ID</strong></td><td>The UUID that identifies your subscription (i.e. Pay-As-You-GO) to use Azure services.</td><td></td></tr><tr><td><strong>Tenant ID</strong></td><td>The UUID of the Azure Active Directory</td><td></td></tr></tbody></table>

{% hint style="info" %}
For more details on all the configurable fields in the PAM Configuration record, visit this [page](https://docs.keeper.io/en/keeperpam/privileged-access-manager/getting-started/pam-configuration).
{% endhint %}

## 3. Set up PAM User records

Keeper Rotation will use the credentials linked from the **PAM Machine** record to rotate the credentials of accounts referenced by the **PAM User** records.

The following table lists all the required fields that need to be filled on the **PAM User** record:

<table><thead><tr><th width="194.5">Field</th><th>Description</th></tr></thead><tbody><tr><td><strong>Title</strong></td><td>Keeper record title i.e. <code>Local User1</code></td></tr><tr><td><strong>Login</strong></td><td>Case sensitive username of the account being rotated. The username has to be in one of the following formats:<br><code>domain\username</code> <code>username@domain</code></td></tr><tr><td><strong>Password</strong></td><td>Account password is optional, rotation will set one if blank</td></tr></tbody></table>

## 4. Configure Rotation on the PAM User records

Select the PAM User record(s) from Step 3, edit the record and open the "Password Rotation Settings".

* Select the desired schedule and password complexity.
* The "Rotation Settings" should use the **PAM Configuration** setup previously.
* The "Resource Credential" field should select the **PAM Machine** admin credential specific to this user's machine.
* Upon saving, the rotation button will be enabled and available to rotate on demand, or via the selected schedule.

Any user with `edit` rights to a **PAM User** record has the ability to setup rotation for that record.

### Helpful Resources

* [Setting up WinRM on your Azure VM](https://docs.keeper.io/en/keeperpam/privileged-access-manager/references/setting-up-winrm)

## Service Management

Keeper can automatically update the Windows service account "log on as" credentials for any Windows services running as the PAM User, and restart the service. Keeper will also update the credential of any scheduled task running as that user on the target machine.

To learn more and set up this capability, see the [Service Management](https://docs.keeper.io/en/keeperpam/privileged-access-manager/password-rotation/service-management) page.
