Skip to content

Commit 1519d84

Browse files
Update virtual-file-mount.md
1 parent 3fd64d3 commit 1519d84

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

articles/batch/virtual-file-mount.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,19 @@ You can mount an Azure file share on a Batch pool using [Azure PowerShell](/powe
5858

5959
1. Sign in to your Azure subscription.
6060

61-
```powershell
61+
```powershell-interactive
6262
Connect-AzAccount -Subscription "<subscription-ID>"
6363
```
6464
6565
1. Get the context for your Batch account.
6666
67-
```powershell
67+
```powershell-interactive
6868
$context = Get-AzBatchAccount -AccountName <batch-account-name>
6969
```
7070
7171
1. Create a Batch pool with the following settings. Replace the sample values with your own information as needed.
7272
73-
```powershell
73+
```powershell-interactive
7474
$fileShareConfig = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSAzureFileShareConfiguration" -ArgumentList @("<Storage-Account-name>", "https://<Storage-Account-name>.file.core.windows.net/batchfileshare1", "S", "Storage-Account-key")
7575
7676
$mountConfig = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSMountConfiguration" -ArgumentList @($fileShareConfig)
@@ -84,7 +84,7 @@ You can mount an Azure file share on a Batch pool using [Azure PowerShell](/powe
8484
8585
1. Access the mount files using your drive's direct path. For example:
8686
87-
```powershell
87+
```powershell-interactive
8888
cmd /c "more S:\folder1\out.txt & timeout /t 90 > NULL"
8989
```
9090
@@ -94,27 +94,27 @@ You can mount an Azure file share on a Batch pool using [Azure PowerShell](/powe
9494
9595
Use `cmdkey` to add your credentials. Replace the sample values with your own information.
9696
97-
```powershell
97+
```powershell-interactive
9898
cmdkey /add:"<storage-account-name>.file.core.windows.net" /user:"Azure\<storage-account-name>" /pass:"<storage-account-key>"
9999
```
100100
101101
# [Linux](#tab/linux)
102102
103103
1. Sign in to your Azure subscription.
104104
105-
```powershell
105+
```powershell-interactive
106106
Connect-AzAccount -Subscription "<subscription-ID>"
107107
```
108108
109109
1. Get the context for your Batch account.
110110
111-
```powershell
111+
```powershell-interactive
112112
$context = Get-AzBatchAccount -AccountName <batch-account-name>
113113
```
114114
115115
1. Create a Batch pool with the following settings. Replace the sample values with your own information as needed.
116116
117-
```powershell
117+
```powershell-interactive
118118
$fileShareConfig = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSAzureFileShareConfiguration" -ArgumentList @("<Storage-Account-name>", https://<Storage-Account-name>.file.core.windows.net/batchfileshare1, "S", "<Storage-Account-key>", "-o vers=3.0,dir_mode=0777,file_mode=0777,sec=ntlmssp")
119119
120120
$mountConfig = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSMountConfiguration" -ArgumentList @($fileShareConfig)
@@ -153,7 +153,7 @@ MountConfigurationPath: S
153153

154154
If you receive this error, RDP or SSH to the node to check the related log files. The Batch agent implements mounting differently on Windows and Linux. On Linux, Batch installs the package `cifs-utils`. Then, Batch issues the mount command. On Windows, Batch uses `cmdkey` to add your Batch account credentials. Then, Batch issues the mount command through `net use`. For example:
155155

156-
```powershell
156+
```powershell-interactive
157157
net use S: \\<storage-account-name>.file.core.windows.net\<fileshare> /u:AZURE\<storage-account-name> <storage-account-key>
158158
```
159159

@@ -235,7 +235,7 @@ If you're unable to diagnose or fix mounting errors with PowerShell, you can mou
235235
236236
1. Create a pool without a mounting configuration. For example:
237237
238-
```powershell
238+
```powershell-interactive
239239
$imageReference = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSImageReference" -ArgumentList @("WindowsServer", "MicrosoftWindowsServer", "2016-Datacenter", "latest")
240240
241241
$configuration = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSVirtualMachineConfiguration" -ArgumentList @($imageReference, "batch.node.windows amd64")
@@ -276,7 +276,7 @@ If you're unable to diagnose or fix mounting errors with PowerShell, you can mou
276276
277277
1. Create a pool without a mounting configuration. For example:
278278
279-
```bash
279+
```powershell-interactive
280280
$imageReference = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSImageReference" -ArgumentList @("ubuntuserver", "canonical", "20.04-lts", "latest")
281281
282282
$configuration = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSVirtualMachineConfiguration" -ArgumentList @($imageReference, "batch.node.ubuntu 20.04")

0 commit comments

Comments
 (0)