title | description | ms.topic | ms.author | author | ms.date |
---|---|---|---|---|---|
Enable managed identities on your lab VMs |
This article shows how a lab owner can enable user-assigned managed identities on your lab virtual machines. |
how-to |
rosemalcolm |
RoseHJM |
06/26/2020 |
As a lab owner, you can enable user-assigned managed identities on your lab virtual machines (VMs) in Azure DevTest Labs.
A managed identity can be used to authenticate to any service that supports Azure Active Directory (AD) authentication, including Key Vault, without passing any credentials in the code. For more information on managed identities, see What is managed identities for Azure resources?.
With this feature, lab users can share Azure resources such as Azure SQL Database in the context of the lab. The authentication to the resource is taken care by the identity itself. Once configured, every existing/newly created lab VM will be enabled with this identity. Lab users can access resources once logged in to their machines.
Note
You can add multiple user assigned managed identities to be enabled on your lab VMs.
To add a user assigned managed identity for lab VMs, follow these steps:
-
Create a user-assigned managed identity in your subscription
-
Navigate to the Configuration and policies page for your lab.
-
Select Identity (Preview) on the left menu.
-
Select the Virtual machine tab.
-
Select Add to select an existing identity from a pre-populated dropdown list.
-
Select an existing user-managed identity from the dropped-down list, and select OK.
-
After creating an identity, note the resource ID of the identity. It should look like the following sample:
/subscriptions/0000000000-0000-0000-0000-00000000000000/resourceGroups/{rg}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}
. -
Perform a PUT HTTPS method on the lab resource to add one or multiple user assigned identities to the managementIdentities field.
{ "location": "southeastasia", "properties": { ... "managementIdentities": { "/subscriptions/0000000000-0000-0000-0000-00000000000000/resourceGroups/{rg}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}": {} }, ... }, ... }
To learn more about managed identities, see What is managed identities for Azure resources?.