Skip to content

Commit 891beae

Browse files
Merge pull request #313288 from khdownie/kendownie031726-2
add user assigned MI to Windows flow
2 parents 7b42514 + 477769f commit 891beae

1 file changed

Lines changed: 23 additions & 6 deletions

File tree

articles/storage/files/files-managed-identities.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: This article explains how you can authenticate managed identities t
44
author: khdownie
55
ms.service: azure-file-storage
66
ms.topic: how-to
7-
ms.date: 03/16/2026
7+
ms.date: 03/17/2026
88
ms.author: kendownie
99
ms.custom:
1010
- devx-track-azurepowershell
@@ -155,14 +155,24 @@ The enablement steps described here are for Azure VMs. If you want to enable a m
155155

156156
### Enable managed identity on an Azure VM
157157

158-
Follow these steps to enable a managed identity on a Windows VM running in Azure.
158+
The managed identity can be either [system assigned or user assigned](/entra/identity/managed-identities-azure-resources/overview#differences-between-system-assigned-and-user-assigned-managed-identities). If the VM has both system assigned and user assigned managed identities, Azure defaults to system assigned. Assign only one for best results.
159+
160+
#### Enable a system assigned managed identity
161+
162+
Follow these steps to enable a system assigned managed identity on a Windows VM running in Azure.
159163

160164
1. Sign in to the Azure portal and create a Windows VM. Your VM must run Windows Server 2019 or higher for server versions, or any Windows client version. See [Create a Windows virtual machine in the Azure portal](/azure/virtual-machines/windows/quick-create-portal).
161165

162-
1. Enable a managed identity on the VM. It can be either [system assigned or user assigned](/entra/identity/managed-identities-azure-resources/overview#differences-between-system-assigned-and-user-assigned-managed-identities). If the VM has both system assigned and user assigned identities, Azure defaults to system assigned. Assign only one for best results. You can enable a system assigned managed identity during VM creation on the **Management** tab.
166+
1. You can enable a system assigned managed identity during VM creation on the **Management** tab.
163167

164168
:::image type="content" source="media/managed-identities/enable-system-assigned-managed-identity.png" alt-text="Screenshot showing how to enable system assigned managed identity when creating a new VM using the Azure portal." border="true":::
165169

170+
#### Enable a user assigned managed identity
171+
172+
1. Sign in to the Azure portal and follow the steps to [create a user assigned managed identity](/entra/identity/managed-identities-azure-resources/manage-user-assigned-managed-identities-azure-portal#create-a-user-assigned-managed-identity).
173+
174+
1. Go to the user assigned managed identity you just created and copy the **Client ID**. You need this value later.
175+
166176
### Assign a built-in RBAC role to the managed identity or application identity
167177

168178
After you enable a managed identity, grant all necessary permissions through Azure RBAC. To assign roles, sign in as a user with role assignment write permission at the scope where you want to assign the role.
@@ -185,6 +195,13 @@ Follow these steps to assign the built-in Azure RBAC role [Storage File Data SMB
185195

186196
1. Select **Review + assign** to add the role assignment to the storage account.
187197

198+
### Add user assigned managed identity to VM
199+
200+
If you created a user assigned managed identity, follow these steps to add it to your VM.
201+
202+
1. Go to your VM. From the service menu, under **Security**, select **Identity**.
203+
204+
1. Select the **User assigned** tab, and then select **Add user assigned managed identity**. Select the managed identity you created, and then select **Add**.
188205

189206
### [Linux](#tab/linux)
190207

@@ -269,13 +286,13 @@ To prepare your client VM or Windows device to authenticate by using a managed i
269286

270287
Before you can mount the file share by using the managed identity, refresh the authentication credentials and specify your storage account endpoint. To copy your storage account URI, go to the storage account in the Azure portal and then select **Settings** > **Endpoints** from the service menu. Be sure to copy the entire URI including the trailing slash: `https://<storage-account-name>.file.core.windows.net/`
271288

289+
For a system assigned managed identity, run the following command to get an OAuth token, insert it in the Kerberos cache, and auto-refresh when the token is close to expiration. You can optionally omit the `refresh`.
290+
272291
```powershell
273292
AzFilesSmbMIClient.exe refresh --uri https://<storage-account-name>.file.core.windows.net/
274293
```
275294

276-
This command gets an OAuth token and inserts it in the Kerberos cache. It auto-refreshes when the token is close to expiration. You can optionally omit the `refresh`.
277-
278-
If your Windows VM has both user assigned and system assigned managed identities configured, use the following command to specify the user assigned managed identity. Replace `<client-id>` with the Client ID of the managed identity.
295+
For a user assigned managed identity, you need to specify the Client ID. Replace `<client-id>` with the Client ID of the managed identity.
279296

280297
```powershell
281298
AzFilesSmbMIClient.exe refresh --uri https://<storage-account-name>.file.core.windows.net/ --clientId <client-id>

0 commit comments

Comments
 (0)