在 azvm 中使用 az cli,我希望能夠列出特定容器 blob 中的所有檔案,然后下載這些檔案。假設我有一個容器“頂部”,然后它有幾個子目錄,例如:
top/sub1/sub2/sub3/
在檔案夾 sub3 中,有多個檔案。我想:
列出sub3中的所有檔案,然后
通過 az cli 檢索 sub3 中的所有檔案。
我只能使用以下命令列出“頂部”中的內容:
az storage container list --account-key ${key} --account-name top --query "[].{Name:name}" --output table
uj5u.com熱心網友回復:
az storage container list--> 用于列出存盤帳戶中的容器。
根據共享資訊,我們了解到您正在嘗試列出 contianer 內的子目錄 (sub1/sub2/sub3) 下的 blob,top那么您需要使用az storage blob directory list用于列出存盤目錄中的 blob 和 blob 子目錄的 cmdlet。
為了測驗這一點,我們創建了一個包含一個容器(頂部)和多個子目錄(sub1/sub2/sub3)的存盤帳戶,我們使用下面的 cmdlet 列出了其中的 blob。
az storage blob directory list -c top -d sub1/sub2/sub3 --account-name <storageAccountName> --query [].name -o table
以下是供參考的示例輸出:

有關az storage blob directory list cmdlet 的詳細資訊的參考檔案。
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/527547.html
標籤:天蓝色命令行界面
上一篇:試圖清理我制作的PS腳本
