Skip to content

Commit 9310904

Browse files
Merge pull request #313809 from khdownie/kendownie032726
added azure cli
2 parents 8f01948 + 6764b7d commit 9310904

1 file changed

Lines changed: 38 additions & 2 deletions

File tree

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

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how to authenticate managed identities to allow applications
44
author: khdownie
55
ms.service: azure-file-storage
66
ms.topic: how-to
7-
ms.date: 03/23/2026
7+
ms.date: 03/27/2026
88
ms.author: kendownie
99
ms.custom:
1010
- devx-track-azurepowershell
@@ -144,11 +144,47 @@ New-AzStorageShare -Name <file-share-name> -Context $storageAccount.Context
144144

145145
You now have a storage account and file share ready for SMB OAuth authentication. Verify in the Azure portal that your storage account and file share were created.
146146

147+
### [Azure CLI](#tab/cli)
148+
149+
To enable the `SMBOAuth` property on your storage account by using Azure CLI, first sign in to Azure:
150+
151+
```azurecli
152+
az login
153+
```
154+
155+
Select your subscription by specifying your subscription ID:
156+
157+
```azurecli
158+
az account set --subscription "<subscription-ID>"
159+
```
160+
161+
### Create the storage account
162+
163+
To create a new storage account with `SMBOAuth` enabled, run the following command. Replace `<resource-group>`, `<storage-account-name>`, and `<region>` with your values.
164+
165+
```azurecli
166+
az storage account create --resource-group <resource-group> --name <storage-account-name> --location <region> --sku Standard_LRS --enable-smb-oauth true
167+
```
168+
169+
To enable SMBOAuth on an existing storage account, run the following command. Replace `<resource-group>` and `<storage-account-name>` with your values.
170+
171+
```azurecli
172+
az storage account update --resource-group <resource-group> --name <storage-account-name> --enable-smb-oauth true
173+
```
174+
175+
Next, create an SMB file share on the storage account. Replace `<storage-account-name>` and `<file-share-name>` with your values.
176+
177+
```azurecli
178+
az storage share create --account-name <storage-account-name> --name <file-share-name>
179+
```
180+
181+
You now have a storage account and file share ready for SMB OAuth authentication. Verify in the Azure portal that your storage account and file share were created.
182+
147183
---
148184

149185
## Configure a managed identity
150186

151-
You can use managed identities with Windows or Linux. Select your operating system and follow the instructions.
187+
You can use managed identities with Windows or Linux. Select your operating system at the beginning of this article and follow the instructions.
152188

153189
::: zone pivot="windows"
154190

0 commit comments

Comments
 (0)