@@ -83,7 +83,7 @@ uname -r
83
83
httpEndpoint=$( az storage account show \
84
84
--resource-group $resourceGroupName \
85
85
--name $storageAccountName \
86
- --query " primaryEndpoints.file" | tr -d ' "' )
86
+ --query " primaryEndpoints.file" --output tsv | tr -d ' "' )
87
87
smbPath=$( echo $httpEndpoint | cut -c7-$( expr length $httpEndpoint ) )
88
88
fileHost=$( echo $smbPath | tr -d " /" )
89
89
@@ -125,13 +125,13 @@ Next, mount the file share using the `mount` command. In the following example,
125
125
httpEndpoint=$( az storage account show \
126
126
--resource-group $resourceGroupName \
127
127
--name $storageAccountName \
128
- --query " primaryEndpoints.file" | tr -d ' "' )
128
+ --query " primaryEndpoints.file" --output tsv | tr -d ' "' )
129
129
smbPath=$( echo $httpEndpoint | cut -c7-$( expr length $httpEndpoint ) ) $fileShareName
130
130
131
131
storageAccountKey=$( az storage account keys list \
132
132
--resource-group $resourceGroupName \
133
133
--account-name $storageAccountName \
134
- --query " [0].value" | tr -d ' "' )
134
+ --query " [0].value" --output tsv | tr -d ' "' )
135
135
136
136
sudo mount -t cifs $smbPath $mntPath -o username=$storageAccountName ,password=$storageAccountKey ,serverino
137
137
` ` `
@@ -142,13 +142,13 @@ sudo mount -t cifs $smbPath $mntPath -o username=$storageAccountName,password=$s
142
142
httpEndpoint=$( az storage account show \
143
143
--resource-group $resourceGroupName \
144
144
--name $storageAccountName \
145
- --query " primaryEndpoints.file" | tr -d ' "' )
145
+ --query " primaryEndpoints.file" --output tsv | tr -d ' "' )
146
146
smbPath=$( echo $httpEndpoint | cut -c7-$( expr length $httpEndpoint ) ) $fileShareName
147
147
148
148
storageAccountKey=$( az storage account keys list \
149
149
--resource-group $resourceGroupName \
150
150
--account-name $storageAccountName \
151
- --query " [0].value" | tr -d ' "' )
151
+ --query " [0].value" --output tsv | tr -d ' "' )
152
152
153
153
sudo mount -t cifs $smbPath $mntPath -o vers=3.0,username=$storageAccountName ,password=$storageAccountKey ,serverino
154
154
` ` `
@@ -159,13 +159,13 @@ sudo mount -t cifs $smbPath $mntPath -o vers=3.0,username=$storageAccountName,pa
159
159
httpEndpoint=$( az storage account show \
160
160
--resource-group $resourceGroupName \
161
161
--name $storageAccountName \
162
- --query " primaryEndpoints.file" | tr -d ' "' )
162
+ --query " primaryEndpoints.file" --output tsv | tr -d ' "' )
163
163
smbPath=$( echo $httpEndpoint | cut -c7-$( expr length $httpEndpoint ) ) $fileShareName
164
164
165
165
storageAccountKey=$( az storage account keys list \
166
166
--resource-group $resourceGroupName \
167
167
--account-name $storageAccountName \
168
- --query " [0].value" | tr -d ' "' )
168
+ --query " [0].value" --output tsv | tr -d ' "' )
169
169
170
170
sudo mount -t cifs $smbPath $mntPath -o vers=2.1,username=$storageAccountName ,password=$storageAccountKey ,serverino
171
171
` ` `
@@ -203,7 +203,7 @@ sudo mkdir -p "/etc/smbcredentials"
203
203
storageAccountKey=$( az storage account keys list \
204
204
--resource-group $resourceGroupName \
205
205
--account-name $storageAccountName \
206
- --query " [0].value" | tr -d ' "' )
206
+ --query " [0].value" --output tsv | tr -d ' "' )
207
207
208
208
# Create the credential file for this individual storage account
209
209
smbCredentialFile=" $credentialRoot /$storageAccountName .cred"
@@ -236,7 +236,7 @@ Finally, create a record in the `/etc/fstab` file for your Azure file share. In
236
236
httpEndpoint=$( az storage account show \
237
237
--resource-group $resourceGroupName \
238
238
--name $storageAccountName \
239
- --query " primaryEndpoints.file" | tr -d ' "' )
239
+ --query " primaryEndpoints.file" --output tsv | tr -d ' "' )
240
240
smbPath=$( echo $httpEndpoint | cut -c7-$( expr length $httpEndpoint ) ) $fileShareName
241
241
242
242
if [ -z " $( grep $smbPath \ $mntPath /etc/fstab) " ]; then
@@ -285,7 +285,7 @@ fileShareName="<file-share-name>"
285
285
httpEndpoint=$( az storage account show \
286
286
--resource-group $resourceGroupName \
287
287
--name $storageAccountName \
288
- --query " primaryEndpoints.file" | tr -d ' "' )
288
+ --query " primaryEndpoints.file" --output tsv | tr -d ' "' )
289
289
smbPath=$( echo $httpEndpoint | cut -c7-$( expr length $httpEndpoint ) ) $fileShareName
290
290
291
291
echo " $fileShareName -fstype=cifs,credentials=$smbCredentialFile :$smbPath " > /etc/auto.fileshares
@@ -304,4 +304,4 @@ See these links for more information about Azure Files:
304
304
305
305
- [Planning for an Azure Files deployment](storage-files-planning.md)
306
306
- [Remove SMB 1 on Linux](files-remove-smb1-linux.md)
307
- - [Troubleshooting](storage-troubleshoot-linux-file-connection-problems.md)
307
+ - [Troubleshooting](storage-troubleshoot-linux-file-connection-problems.md)
0 commit comments