@@ -58,19 +58,19 @@ You can mount an Azure file share on a Batch pool using [Azure PowerShell](/powe
58
58
59
59
1 . Sign in to your Azure subscription.
60
60
61
- ``` powershell
61
+ ``` powershell-interactive
62
62
Connect-AzAccount -Subscription "<subscription-ID>"
63
63
```
64
64
65
65
1. Get the context for your Batch account.
66
66
67
- ```powershell
67
+ ```powershell-interactive
68
68
$context = Get-AzBatchAccount -AccountName <batch-account-name>
69
69
```
70
70
71
71
1. Create a Batch pool with the following settings. Replace the sample values with your own information as needed.
72
72
73
- ```powershell
73
+ ```powershell-interactive
74
74
$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")
75
75
76
76
$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
84
84
85
85
1. Access the mount files using your drive's direct path. For example:
86
86
87
- ```powershell
87
+ ```powershell-interactive
88
88
cmd /c "more S:\folder1\out.txt & timeout /t 90 > NULL"
89
89
```
90
90
@@ -94,27 +94,27 @@ You can mount an Azure file share on a Batch pool using [Azure PowerShell](/powe
94
94
95
95
Use `cmdkey` to add your credentials. Replace the sample values with your own information.
96
96
97
- ```powershell
97
+ ```powershell-interactive
98
98
cmdkey /add:"<storage-account-name>.file.core.windows.net" /user:"Azure\<storage-account-name>" /pass:"<storage-account-key>"
99
99
```
100
100
101
101
# [Linux](#tab/linux)
102
102
103
103
1. Sign in to your Azure subscription.
104
104
105
- ```powershell
105
+ ```powershell-interactive
106
106
Connect-AzAccount -Subscription "<subscription-ID>"
107
107
```
108
108
109
109
1. Get the context for your Batch account.
110
110
111
- ```powershell
111
+ ```powershell-interactive
112
112
$context = Get-AzBatchAccount -AccountName <batch-account-name>
113
113
```
114
114
115
115
1. Create a Batch pool with the following settings. Replace the sample values with your own information as needed.
116
116
117
- ```powershell
117
+ ```powershell-interactive
118
118
$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")
119
119
120
120
$mountConfig = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSMountConfiguration" -ArgumentList @($fileShareConfig)
@@ -153,7 +153,7 @@ MountConfigurationPath: S
153
153
154
154
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:
155
155
156
- ``` powershell
156
+ ``` powershell-interactive
157
157
net use S: \\<storage-account-name>.file.core.windows.net\<fileshare> /u:AZURE\<storage-account-name> <storage-account-key>
158
158
```
159
159
@@ -235,7 +235,7 @@ If you're unable to diagnose or fix mounting errors with PowerShell, you can mou
235
235
236
236
1. Create a pool without a mounting configuration. For example:
237
237
238
- ```powershell
238
+ ```powershell-interactive
239
239
$imageReference = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSImageReference" -ArgumentList @("WindowsServer", "MicrosoftWindowsServer", "2016-Datacenter", "latest")
240
240
241
241
$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
276
276
277
277
1. Create a pool without a mounting configuration. For example:
278
278
279
- ```bash
279
+ ```powershell-interactive
280
280
$imageReference = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSImageReference" -ArgumentList @("ubuntuserver", "canonical", "20.04-lts", "latest")
281
281
282
282
$configuration = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSVirtualMachineConfiguration" -ArgumentList @($imageReference, "batch.node.ubuntu 20.04")
0 commit comments