Skip to content

Commit 580e344

Browse files
authored
[Storage] Fix #21876: az storage blob upload-batch/download-batch/delete-batch: Add double quotes to --pattern value for unix shell (#28221)
1 parent b44d342 commit 580e344

File tree

1 file changed

+12
-12
lines changed
  • src/azure-cli/azure/cli/command_modules/storage

1 file changed

+12
-12
lines changed

src/azure-cli/azure/cli/command_modules/storage/_help.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -940,16 +940,16 @@
940940
- name: Delete all blobs ending with ".py" in a container that have not been modified for 10 days.
941941
text: |
942942
date=`date -d "10 days ago" '+%Y-%m-%dT%H:%MZ'`
943-
az storage blob delete-batch -s mycontainer --account-name mystorageaccount --pattern *.py --if-unmodified-since $date --auth-mode login
943+
az storage blob delete-batch -s mycontainer --account-name mystorageaccount --pattern "*.py" --if-unmodified-since $date --auth-mode login
944944
- name: Delete all the blobs in a directory named "dir" in a container named "mycontainer".
945945
text: |
946-
az storage blob delete-batch -s mycontainer --pattern dir/*
946+
az storage blob delete-batch -s mycontainer --pattern "dir/*"
947947
- name: Delete the blobs with the format 'cli-2018-xx-xx.txt' or 'cli-2019-xx-xx.txt' in a container.
948948
text: |
949-
az storage blob delete-batch -s mycontainer --pattern cli-201[89]-??-??.txt
949+
az storage blob delete-batch -s mycontainer --pattern "cli-201[89]-??-??.txt"
950950
- name: Delete all blobs with the format 'cli-201x-xx-xx.txt' except cli-2018-xx-xx.txt' and 'cli-2019-xx-xx.txt' in a container.
951951
text: |
952-
az storage blob delete-batch -s mycontainer --pattern cli-201[!89]-??-??.txt
952+
az storage blob delete-batch -s mycontainer --pattern "cli-201[!89]-??-??.txt"
953953
"""
954954

955955
helps['storage blob download-batch'] = """
@@ -973,16 +973,16 @@
973973
examples:
974974
- name: Download all blobs that end with .py
975975
text: |
976-
az storage blob download-batch -d . --pattern *.py -s mycontainer --account-name mystorageaccount --account-key 00000000
976+
az storage blob download-batch -d . --pattern "*.py" -s mycontainer --account-name mystorageaccount --account-key 00000000
977977
- name: Download all blobs in a directory named "dir" from container named "mycontainer".
978978
text: |
979-
az storage blob download-batch -d . -s mycontainer --pattern dir/*
979+
az storage blob download-batch -d . -s mycontainer --pattern "dir/*"
980980
- name: Download all blobs with the format 'cli-2018-xx-xx.txt' or 'cli-2019-xx-xx.txt' in container to current path.
981981
text: |
982-
az storage blob download-batch -d . -s mycontainer --pattern cli-201[89]-??-??.txt
982+
az storage blob download-batch -d . -s mycontainer --pattern "cli-201[89]-??-??.txt"
983983
- name: Download all blobs with the format 'cli-201x-xx-xx.txt' except cli-2018-xx-xx.txt' and 'cli-2019-xx-xx.txt' in container to current path.
984984
text: |
985-
az storage blob download-batch -d . -s mycontainer --pattern cli-201[!89]-??-??.txt
985+
az storage blob download-batch -d . -s mycontainer --pattern "cli-201[!89]-??-??.txt"
986986
"""
987987

988988
helps['storage blob exists'] = """
@@ -1316,16 +1316,16 @@
13161316
examples:
13171317
- name: Upload all files that end with .py unless blob exists and has been modified since given date.
13181318
text: |
1319-
az storage blob upload-batch -d mycontainer --account-name mystorageaccount --account-key 00000000 -s <path-to-directory> --pattern *.py --if-unmodified-since 2018-08-27T20:51Z
1319+
az storage blob upload-batch -d mycontainer --account-name mystorageaccount --account-key 00000000 -s <path-to-directory> --pattern "*.py" --if-unmodified-since 2018-08-27T20:51Z
13201320
- name: Upload all files from local path directory to a container named "mycontainer".
13211321
text: |
13221322
az storage blob upload-batch -d mycontainer -s <path-to-directory>
13231323
- name: Upload all files with the format 'cli-2018-xx-xx.txt' or 'cli-2019-xx-xx.txt' in local path directory.
13241324
text: |
1325-
az storage blob upload-batch -d mycontainer -s <path-to-directory> --pattern cli-201[89]-??-??.txt
1325+
az storage blob upload-batch -d mycontainer -s <path-to-directory> --pattern "cli-201[89]-??-??.txt"
13261326
- name: Upload all files with the format 'cli-201x-xx-xx.txt' except cli-2018-xx-xx.txt' and 'cli-2019-xx-xx.txt' in a container.
13271327
text: |
1328-
az storage blob upload-batch -d mycontainer -s <path-to-directory> --pattern cli-201[!89]-??-??.txt
1328+
az storage blob upload-batch -d mycontainer -s <path-to-directory> --pattern "cli-201[!89]-??-??.txt"
13291329
"""
13301330

13311331
helps['storage blob download'] = """
@@ -2004,7 +2004,7 @@
20042004
crafted: true
20052005
- name: Delete files from an Azure Storage File Share. (autogenerated)
20062006
text: |
2007-
az storage file delete-batch --account-key 00000000 --account-name MyAccount --pattern *.py --source /path/to/file
2007+
az storage file delete-batch --account-key 00000000 --account-name MyAccount --pattern "*.py" --source /path/to/file
20082008
crafted: true
20092009
"""
20102010

0 commit comments

Comments
 (0)