Skip to content

Commit 5a5770b

Browse files
Merge pull request #313572 from khdownie/kendownie032326-3
add zone pivots for operating systems
2 parents 70cd635 + d193e7e commit 5a5770b

2 files changed

Lines changed: 41 additions & 21 deletions

File tree

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

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ ms.date: 03/23/2026
88
ms.author: kendownie
99
ms.custom:
1010
- devx-track-azurepowershell
11+
zone_pivot_groups: azure-files-windows-linux
1112
# Customer intent: As a cloud administrator, I want to improve security by authenticating managed identities to allow applications and virtual machines to access SMB Azure Files shares using identity-based authentication with Microsoft Entra ID instead of using a storage account key.
1213
---
1314

@@ -59,7 +60,7 @@ To authenticate a managed identity, you must enable the **SMBOAuth** property on
5960

6061
To enable the **SMBOAuth** property on your storage account, use either the Azure portal or Azure PowerShell. For instructions, select the appropriate tab.
6162

62-
### [Portal](#tab/windows)
63+
### [Portal](#tab/portal)
6364

6465
To create a new storage account with the **SMBOAuth** property enabled by using the Azure portal, follow [these steps](create-classic-file-share.md#create-a-storage-account). Under the **Advanced** tab, select the **Enable Managed Identity for SMB** checkbox.
6566

@@ -73,7 +74,7 @@ Go to the storage account. From the service menu, under **Settings**, select **C
7374

7475
Next, [create an SMB file share](create-classic-file-share.md) on the storage account.
7576

76-
### [PowerShell](#tab/linux)
77+
### [PowerShell](#tab/powershell)
7778

7879
To enable the **SMBOAuth** property on your storage account by using Azure PowerShell, first prepare your PowerShell environment.
7980

@@ -147,9 +148,9 @@ You now have a storage account and file share ready for SMB OAuth authentication
147148

148149
## Configure managed identity
149150

150-
You can use managed identities with Windows or Linux. Select the appropriate tab and follow the instructions for your operating system.
151+
You can use managed identities with Windows or Linux. Select your operating system and follow the instructions.
151152

152-
### [Windows](#tab/windows)
153+
::: zone pivot="windows"
153154

154155
The enablement steps described here are for Azure VMs. If you want to enable a managed identity on non-Azure Windows machines (on-premises or other cloud), you must [onboard them to Azure Arc and assign a managed identity](/azure/cloud-adoption-framework/scenarios/hybrid/arc-enabled-servers/eslz-identity-and-access-management). You can also authenticate by using an application identity instead of using a managed identity on a VM or Windows device.
155156

@@ -203,7 +204,9 @@ If you created a user assigned managed identity, follow these steps to add it to
203204

204205
1. Select the **User assigned** tab, and then select **Add user assigned managed identity**. Select the managed identity you created, and then select **Add**.
205206

206-
### [Linux](#tab/linux)
207+
::: zone-end
208+
209+
::: zone pivot="linux"
207210

208211
To configure a managed identity on a Linux VM running in Azure, follow these steps. Your VM must be running Azure Linux 3.0, Ubuntu 22.04, Ubuntu 24.04, RHEL 9.6+, or SLES 15 SP6+.
209212

@@ -251,13 +254,13 @@ If you created a user assigned managed identity, follow these steps to add it to
251254

252255
1. Select the **User assigned** tab, and then select **Add user assigned managed identity**. Select the managed identity you created, and then select **Add**.
253256

254-
---
257+
::: zone-end
255258

256259
## Prepare your client to authenticate by using a managed identity
257260

258261
Follow these steps to prepare your system to mount the file share using managed identity authentication. The steps are different for Windows and Linux clients. Clients shouldn't be domain joined.
259262

260-
### [Windows](#tab/windows)
263+
::: zone pivot="windows"
261264

262265
To prepare your client VM or Windows device to authenticate by using a managed identity, follow these steps.
263266

@@ -292,7 +295,7 @@ For a system assigned managed identity, run the following command to get an OAut
292295
AzFilesSmbMIClient.exe refresh --uri https://<storage-account-name>.file.core.windows.net/
293296
```
294297

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.
298+
For a user assigned managed identity, you need to specify the client ID. Replace `<client-id>` with the client ID of the managed identity.
296299

297300
```powershell
298301
AzFilesSmbMIClient.exe refresh --uri https://<storage-account-name>.file.core.windows.net/ --clientId <client-id>
@@ -301,7 +304,9 @@ AzFilesSmbMIClient.exe refresh --uri https://<storage-account-name>.file.core.wi
301304
> [!TIP]
302305
> To view complete usage information and examples, run the executable without any parameters: `AzFilesSmbMIClient.exe`
303306
304-
### [Linux](#tab/linux)
307+
::: zone-end
308+
309+
::: zone pivot="linux"
305310

306311
To prepare your Linux VM to authenticate by using a managed identity, follow these steps.
307312

@@ -399,13 +404,13 @@ You have two options for configuring authentication on Linux:
399404
400405
You can use a system assigned or user assigned managed identity to configure authentication.
401406
402-
If your VM has a user assigned managed identity, run the following command to get a token from the Azure Instance Metadata Service (IMDS) and store it automatically. Replace `<storage-account-name>` with your storage account name. Replace `<client-id>` with the client ID of your managed identity. If you don't have the Client ID, go to the managed identity in the Azure portal and copy the Client ID.
407+
If your VM has a user assigned managed identity, run the following command to get a token from the Azure Instance Metadata Service (IMDS) and store it automatically. Replace `<storage-account-name>` with your storage account name. Replace `<client-id>` with the client ID of your managed identity. If you don't have the client ID, go to the managed identity in the Azure portal and copy the client ID.
403408
404409
```bash
405410
sudo azfilesauthmanager set https://<storage-account-name>.file.core.windows.net --imds-client-id <client-id>
406411
```
407412
408-
If your VM has a system assigned managed identity, use the `--system` flag:
413+
If your VM has a system assigned managed identity, use the `--system` flag and don't supply a client ID:
409414
410415
```bash
411416
sudo azfilesauthmanager set https://<storage-account-name>.file.core.windows.net --system
@@ -430,21 +435,23 @@ sudo azfilesauthmanager set https://<storage-account-name>.file.core.windows.net
430435
sudo azfilesauthmanager list
431436
```
432437
433-
---
438+
::: zone-end
434439
435440
## Mount the file share
436441
437442
You can now mount the file share on Windows or Linux without using a storage account key.
438443
439-
### [Windows](#tab/windows)
444+
::: zone pivot="windows"
440445
441446
On Windows clients, you can directly access your Azure file share using the UNC path by entering the following path into Windows File Explorer. Replace `<storage-account-name>` with your storage account name and `<file-share-name>` with your file share name:
442447
443448
`\\<storage-account-name>.file.core.windows.net\<file-share-name>`
444449
445450
For more information, see [Mount SMB Azure file share on Windows](storage-how-to-use-files-windows.md).
446451
447-
### [Linux](#tab/linux)
452+
::: zone-end
453+
454+
::: zone pivot="linux"
448455
449456
Run the following command to mount the file share with the recommended mount options. Replace `<storage-account-name>` with your storage account name and `<file-share-name>` with your file share name. You can find your credential ID in the following config file: `cat /etc/azfilesauth/config.yaml`. For a user assigned managed identity, include the client ID of the managed identity using the `username=<client-id>` mount option. For a system assigned managed identity, omit the mount option `username=<client-id>`.
450457
@@ -478,13 +485,13 @@ sudo systemctl enable --now azfilesrefresh
478485
479486
Automatic credential refresh requires a managed identity assigned to your VM. If you're supplying the OAuth token directly, you must refresh credentials manually by using the `azfilesauthmanager set` command as described in [Configure authentication](#configure-authentication), or programmatically via the shared library APIs.
480487
481-
---
488+
::: zone-end
482489
483490
## Troubleshooting
484491
485492
Troubleshooting steps are different for Windows and Linux clients.
486493
487-
### [Windows](#tab/windows)
494+
::: zone pivot="windows"
488495
489496
If you encounter problems when mounting your file share on Windows, follow these steps to enable verbose logging and collect diagnostic information.
490497
@@ -494,17 +501,19 @@ If you encounter problems when mounting your file share on Windows, follow these
494501
495502
1. You should now have a file named `AzFilesSmbMILog.log`. Send the log file to [email protected] for assistance.
496503
497-
### [Linux](#tab/linux)
504+
::: zone-end
505+
506+
::: zone pivot="linux"
498507
499508
If you encounter problems when mounting your file share on Linux, follow [these SMB diagnostics steps](https://github.com/Azure-Samples/azure-files-samples/tree/master/SMBDiagnostics).
500509
501-
---
510+
::: zone-end
502511
503512
## Client library installation and integration options
504513
505514
The following information is for developers who need to integrate managed identities into their applications.
506515
507-
### [Windows](#tab/windows)
516+
::: zone pivot="windows"
508517
509518
For developers who need to integrate managed identities into their Windows applications, multiple implementation approaches are available depending on your application architecture and requirements.
510519
@@ -538,7 +547,9 @@ extern "C" AZFILESSMBMI_API HRESULT SmbClearCredential(
538547
);
539548
```
540549
541-
### [Linux](#tab/linux)
550+
::: zone-end
551+
552+
::: zone pivot="linux"
542553
543554
Linux developers can use the shared library that's automatically installed with the `azfilesauth` package. You can link against the library in your C/C++ applications for direct API access.
544555
@@ -581,7 +592,7 @@ The following table lists the API commands and their usage. Returned values foll
581592
| `extern_smb_list_credential()` | Lists all stored credentials. |
582593
| `extern_smb_version()` | Returns the version string of the azfilesauth library. |
583594
584-
---
595+
::: zone-end
585596
586597
## See also
587598

articles/zone-pivot-groups.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2048,3 +2048,12 @@ groups:
20482048
title: Azure CLI
20492049
- id: script
20502050
title: PowerShell script
2051+
# Owner: kendownie
2052+
- id: azure-files-windows-linux
2053+
title: Operating system
2054+
prompt: Choose your operating system
2055+
pivots:
2056+
- id: windows
2057+
title: Windows
2058+
- id: linux
2059+
title: Linux

0 commit comments

Comments
 (0)