azure-managed-identityazure-devtest-labs

How can I add Managed Identity to a DevTest Labs VM?


I want to develop and test MSI on my development Windows VM which I created with DevTest Labs.

Going into the VM directly on Identity (Preview) I can change the setting but the Save keeps being disabled.


Solution

  • I managed to achieve this with Azure CLI:

    1. log in to Azure CLI, select Account
    2. list VMs with az vm list
    3. choose the VM to assign MSI to
    4. run az vm identity assign --name {vm-name} -g {vms resource groupname}

    checking in the portal, VM / Identity tab, the Identity has Status=On