Skip to content

Commit 45c7b71

Browse files
authored
Merge pull request #82524 from stuartleeks/patch-13
Update `az` CLI commands to force expected output
2 parents 9d454b3 + 1563e8c commit 45c7b71

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

articles/storage/files/storage-how-to-use-files-linux.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ uname -r
8383
httpEndpoint=$(az storage account show \
8484
--resource-group $resourceGroupName \
8585
--name $storageAccountName \
86-
--query "primaryEndpoints.file" | tr -d '"')
86+
--query "primaryEndpoints.file" --output tsv | tr -d '"')
8787
smbPath=$(echo $httpEndpoint | cut -c7-$(expr length $httpEndpoint))
8888
fileHost=$(echo $smbPath | tr -d "/")
8989
@@ -125,13 +125,13 @@ Next, mount the file share using the `mount` command. In the following example,
125125
httpEndpoint=$(az storage account show \
126126
--resource-group $resourceGroupName \
127127
--name $storageAccountName \
128-
--query "primaryEndpoints.file" | tr -d '"')
128+
--query "primaryEndpoints.file" --output tsv | tr -d '"')
129129
smbPath=$(echo $httpEndpoint | cut -c7-$(expr length $httpEndpoint))$fileShareName
130130
131131
storageAccountKey=$(az storage account keys list \
132132
--resource-group $resourceGroupName \
133133
--account-name $storageAccountName \
134-
--query "[0].value" | tr -d '"')
134+
--query "[0].value" --output tsv | tr -d '"')
135135
136136
sudo mount -t cifs $smbPath $mntPath -o username=$storageAccountName,password=$storageAccountKey,serverino
137137
```
@@ -142,13 +142,13 @@ sudo mount -t cifs $smbPath $mntPath -o username=$storageAccountName,password=$s
142142
httpEndpoint=$(az storage account show \
143143
--resource-group $resourceGroupName \
144144
--name $storageAccountName \
145-
--query "primaryEndpoints.file" | tr -d '"')
145+
--query "primaryEndpoints.file" --output tsv | tr -d '"')
146146
smbPath=$(echo $httpEndpoint | cut -c7-$(expr length $httpEndpoint))$fileShareName
147147
148148
storageAccountKey=$(az storage account keys list \
149149
--resource-group $resourceGroupName \
150150
--account-name $storageAccountName \
151-
--query "[0].value" | tr -d '"')
151+
--query "[0].value" --output tsv | tr -d '"')
152152
153153
sudo mount -t cifs $smbPath $mntPath -o vers=3.0,username=$storageAccountName,password=$storageAccountKey,serverino
154154
```
@@ -159,13 +159,13 @@ sudo mount -t cifs $smbPath $mntPath -o vers=3.0,username=$storageAccountName,pa
159159
httpEndpoint=$(az storage account show \
160160
--resource-group $resourceGroupName \
161161
--name $storageAccountName \
162-
--query "primaryEndpoints.file" | tr -d '"')
162+
--query "primaryEndpoints.file" --output tsv | tr -d '"')
163163
smbPath=$(echo $httpEndpoint | cut -c7-$(expr length $httpEndpoint))$fileShareName
164164
165165
storageAccountKey=$(az storage account keys list \
166166
--resource-group $resourceGroupName \
167167
--account-name $storageAccountName \
168-
--query "[0].value" | tr -d '"')
168+
--query "[0].value" --output tsv | tr -d '"')
169169
170170
sudo mount -t cifs $smbPath $mntPath -o vers=2.1,username=$storageAccountName,password=$storageAccountKey,serverino
171171
```
@@ -203,7 +203,7 @@ sudo mkdir -p "/etc/smbcredentials"
203203
storageAccountKey=$(az storage account keys list \
204204
--resource-group $resourceGroupName \
205205
--account-name $storageAccountName \
206-
--query "[0].value" | tr -d '"')
206+
--query "[0].value" --output tsv | tr -d '"')
207207
208208
# Create the credential file for this individual storage account
209209
smbCredentialFile="$credentialRoot/$storageAccountName.cred"
@@ -236,7 +236,7 @@ Finally, create a record in the `/etc/fstab` file for your Azure file share. In
236236
httpEndpoint=$(az storage account show \
237237
--resource-group $resourceGroupName \
238238
--name $storageAccountName \
239-
--query "primaryEndpoints.file" | tr -d '"')
239+
--query "primaryEndpoints.file" --output tsv | tr -d '"')
240240
smbPath=$(echo $httpEndpoint | cut -c7-$(expr length $httpEndpoint))$fileShareName
241241
242242
if [ -z "$(grep $smbPath\ $mntPath /etc/fstab)" ]; then
@@ -285,7 +285,7 @@ fileShareName="<file-share-name>"
285285
httpEndpoint=$(az storage account show \
286286
--resource-group $resourceGroupName \
287287
--name $storageAccountName \
288-
--query "primaryEndpoints.file" | tr -d '"')
288+
--query "primaryEndpoints.file" --output tsv | tr -d '"')
289289
smbPath=$(echo $httpEndpoint | cut -c7-$(expr length $httpEndpoint))$fileShareName
290290
291291
echo "$fileShareName -fstype=cifs,credentials=$smbCredentialFile :$smbPath" > /etc/auto.fileshares
@@ -304,4 +304,4 @@ See these links for more information about Azure Files:
304304

305305
- [Planning for an Azure Files deployment](storage-files-planning.md)
306306
- [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

Comments
 (0)