az storage share-rm

使用 Microsoft 管理 Azure 檔案共用。儲存體 資源提供者。

命令

名稱 Description 類型 狀態
az storage share-rm create

在指定的記憶體帳戶下建立新的 Azure 檔案共用。

核心 GA
az storage share-rm delete

刪除指定的 Azure 檔案共享或共用快照集。

核心 GA
az storage share-rm exists

檢查 Azure 檔案共用是否存在。

核心 GA
az storage share-rm list

列出指定記憶體帳戶下的 Azure 檔案共用。

核心 GA
az storage share-rm restore

如果啟用共用虛刪除,請在有效的保留天內還原檔案共用。

核心 GA
az storage share-rm show

顯示指定之 Azure 檔案共享或共用快照集的屬性。

核心 GA
az storage share-rm snapshot

在指定的帳戶下建立現有共用的快照集。

核心 預覽
az storage share-rm stats

取得儲存在共享上的數據使用位元組。

核心 GA
az storage share-rm update

更新 Azure 檔案共享的屬性。

核心 GA

az storage share-rm create

在指定的記憶體帳戶下建立新的 Azure 檔案共用。

az storage share-rm create --name
                           --storage-account
                           [--access-tier {Cool, Hot, Premium, TransactionOptimized}]
                           [--enabled-protocols {NFS, SMB}]
                           [--metadata]
                           [--quota]
                           [--resource-group]
                           [--root-squash {AllSquash, NoRootSquash, RootSquash}]

範例

在資源群組 'MyResourceGroup' 的記憶體帳戶 'mystorageaccount'(帳戶名稱) 下,建立新的 Azure 檔案共用 'myfileshare',並將元數據和配額設定為 10 GB。

az storage share-rm create -g MyResourceGroup --storage-account mystorageaccount --name myfileshare --quota 10 --metadata key1=value1 key2=value2

在記憶體帳戶 'mystorageaccount'(帳戶名稱) 下建立新的 Azure 檔案共用 'myfileshare',其元數據和配額為 6000 GB,可在資源群組 'MyResourceGroup' 中啟用大型檔案共用。

az storage account update -g MyResourceGroup --name mystorageaccount --enable-large-file-share
az storage share-rm create -g MyResourceGroup --storage-account mystorageaccount --name myfileshare --quota 6000 --metadata key1=value1 key2=value2

在記憶體帳戶 'mystorageaccount' 下建立新的 Azure 檔案共用 'myfileshare',其元數據和配額為 10 GB(帳戶標識符)。

az storage share-rm create --storage-account mystorageaccount --name myfileshare --quota 10 --metadata key1=value1 key2=value2

必要參數

--name -n

檔案共享名稱。

--storage-account

記憶體帳戶的名稱或識別碼。

選擇性參數

--access-tier

特定共用的存取層。 GpV2 帳戶可以選擇 TransactionOptimized (預設)、經常性存取和非經常性存取。 檔案 儲存體 帳戶可以選擇 進階版。

接受的值: Cool, Hot, Premium, TransactionOptimized
--enabled-protocols

檔案共用通訊協定的不可變屬性。 NFS 通訊協定僅適用於進階檔案共用(檔案 儲存體 帳戶類型的檔案共用)。

接受的值: NFS, SMB
--metadata

與共用相關聯的空格分隔索引鍵=值組中的元數據。 這會覆寫任何現有的元數據。

--quota -q

以 GB 為單位的共用大小上限。 必須大於 0,且小於或等於 5TB (5120)。 對於大型檔案共用,大小上限為 102400。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--root-squash

減少遠端超級使用者的訪問許可權。

接受的值: AllSquash, NoRootSquash, RootSquash
全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az storage share-rm delete

刪除指定的 Azure 檔案共享或共用快照集。

重大變更:預設無法刪除快照集,如果您想要包含刪除作業的 sanpshots,我們已新增要使用的參數。

az storage share-rm delete [--ids]
                           [--include]
                           [--name]
                           [--resource-group]
                           [--snapshot]
                           [--storage-account]
                           [--subscription]
                           [--yes]

範例

刪除資源群組 'MyResourceGroup' 中儲存體帳戶 'mystorageaccount' (帳戶名稱) 下的 Azure 檔案共用 'myfileshare'。

az storage share-rm delete -g MyResourceGroup --storage-account mystorageaccount --name myfileshare

刪除記憶體帳戶 'mystorageaccount' 底下的 Azure 檔案共用 'myfileshare'(帳戶標識符)。

az storage share-rm delete --storage-account mystorageaccount --name myfileshare

依資源標識碼刪除 Azure 檔案共用。

az storage share-rm delete --ids file-share-id

刪除 Azure 檔案共用快照集。

az storage share-rm delete --ids file-share-id --snapshot "2021-03-25T05:29:56.0000000Z"

刪除 Azure 檔案共用及其所有快照集。

az storage share-rm delete --include snapshots -g MyResourceGroup --storage-account mystorageaccount --name myfileshare

刪除 Azure 檔案共用及其所有快照集(已租用/未發行)。

az storage share-rm delete --include leased-snapshots -g MyResourceGroup --storage-account mystorageaccount --name myfileshare

選擇性參數

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--include

選擇性。 有效值為:快照集、租用快照集、無。 預設值為快照集。 針對「快照集」,檔案共用會遭到刪除,包括其所有檔案共用快照集。 如果檔案共用包含租用快照集,則刪除會失敗。 若為 「leased-snapshots」,則會刪除檔案共用,並包含其所有檔案共用快照集 (leased/unleased)。 若沒有共用快照集,則會刪除檔案共用。 如果檔案共用包含任何快照集(租用或未發行),則刪除會失敗。 預設值為 None。

預設值: none
--name -n

檔案共享名稱。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--snapshot
預覽

DateTime 值,指定要擷取的共用快照集。

--storage-account

記憶體帳戶的名稱或識別碼。

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--yes -y

不提示確認。

預設值: False
全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az storage share-rm exists

檢查 Azure 檔案共用是否存在。

az storage share-rm exists [--ids]
                           [--name]
                           [--resource-group]
                           [--storage-account]
                           [--subscription]

範例

檢查資源群組 'MyResourceGroup' 中記憶體帳戶 'mystorageaccount' (帳戶名稱) 下是否有 Azure 檔案共用 'myfileshare'。

az storage share-rm exists -g MyResourceGroup --storage-account mystorageaccount --name myfileshare

檢查記憶體帳戶 'mystorageaccount' 下是否有 Azure 檔案共用 'myfileshare'(帳戶標識符)。

az storage share-rm exists --storage-account mystorageaccount --name myfileshare

依資源標識子檢查 Azure 檔案共用是否存在。

az storage share-rm exists --ids file-share-id

選擇性參數

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--name -n

檔案共享名稱。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--storage-account

記憶體帳戶的名稱或識別碼。

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az storage share-rm list

列出指定記憶體帳戶下的 Azure 檔案共用。

az storage share-rm list --storage-account
                         [--include-deleted]
                         [--include-snapshot]
                         [--resource-group]

範例

列出資源群組 'MyResourceGroup' 中儲存器帳戶 'mystorageaccount' (帳戶名稱) 下的 Azure 檔案共用。

az storage share-rm list -g MyResourceGroup --storage-account mystorageaccount

列出記憶體帳戶 'mystorageaccount' 底下的 Azure 檔案共用(帳戶標識符)。

az storage share-rm list --storage-account mystorageaccount

列出記憶體帳戶 'mystorageaccount' 底下已刪除的所有檔案共用。

az storage share-rm list --storage-account mystorageaccount --include-deleted

列出所有檔案共用在其記憶體帳戶 'mystorageaccount' 底下的所有快照集。

az storage share-rm list --storage-account mystorageaccount --include-snapshot

列出所有檔案共用,包括其儲存體帳戶 'mystorageaccount' 下的所有快照集和已刪除的檔案共用。

az storage share-rm list --storage-account mystorageaccount --include-deleted --include-snapshot

必要參數

--storage-account

記憶體帳戶的名稱或識別碼。

選擇性參數

--include-deleted

指定時包含虛刪除的檔案共用。

--include-snapshot

指定時包含檔案共用快照集。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az storage share-rm restore

如果啟用共用虛刪除,請在有效的保留天內還原檔案共用。

az storage share-rm restore --deleted-version
                            [--ids]
                            [--name]
                            [--resource-group]
                            [--restored-name]
                            [--storage-account]
                            [--subscription]

範例

如果啟用共用虛刪除,請在有效的保留天內還原檔案共用。

az storage share-rm restore -n deletedshare --deleted-version 01D64EB9886F00C4 -g MyResourceGroup --storage-account mystorageaccount

如果共用虛刪除已啟用至新名稱,請在有效的保留天數內還原檔案共用。

az storage share-rm restore -n deletedshare --deleted-version 01D64EB9886F00C4 --restored-name newname -g MyResourceGroup --storage-account mystorageaccount

必要參數

--deleted-version

識別將還原之已刪除共用的版本。

選擇性參數

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--name -n

檔案共享名稱。 識別將還原之已刪除共享的名稱。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--restored-name

要還原的新檔案共享名稱。 如果未指定,將會使用已刪除的共享名稱。

--storage-account

記憶體帳戶的名稱或識別碼。

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az storage share-rm show

顯示指定之 Azure 檔案共享或共用快照集的屬性。

az storage share-rm show [--expand]
                         [--ids]
                         [--name]
                         [--resource-group]
                         [--snapshot]
                         [--storage-account]
                         [--subscription]

範例

在資源群組 'MyResourceGroup' 中的記憶體帳戶 'mystorageaccount' (帳戶名稱) 底下顯示 Azure 檔案共用 'myfileshare' 的屬性。

az storage share-rm show -g MyResourceGroup --storage-account mystorageaccount --name myfileshare

在記憶體帳戶 'mystorageaccount' 底下顯示 Azure 檔案共用 'myfileshare' 的屬性(帳戶標識符)。

az storage share-rm show --storage-account mystorageaccount --name myfileshare

依資源標識碼顯示 Azure 檔案共享的屬性。

az storage share-rm show --ids file-share-id

顯示 Azure 檔案共用快照集的屬性

az storage share-rm show --ids file-share-id --snapshot "2021-03-25T05:29:56.0000000Z"

選擇性參數

--expand

選擇性,用來展開共用屬性內的屬性。 有效值為:統計數據。應該以具有分隔符 ',' 的字串傳遞。 預設值為 None。

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--name -n

檔案共享名稱。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--snapshot
預覽

DateTime 值,指定要擷取的共用快照集。

--storage-account

記憶體帳戶的名稱或識別碼。

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az storage share-rm snapshot

預覽

此命令處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

在指定的帳戶下建立現有共用的快照集。

az storage share-rm snapshot [--access-tier {Cool, Hot, Premium, TransactionOptimized}]
                             [--enabled-protocols {NFS, SMB}]
                             [--ids]
                             [--metadata]
                             [--name]
                             [--quota]
                             [--resource-group]
                             [--root-squash {AllSquash, NoRootSquash, RootSquash}]
                             [--storage-account]
                             [--subscription]

範例

在指定的帳戶下建立現有共用的快照集。

az storage share-rm snapshot -g MyResourceGroup --storage-account mystorageaccount --name myfileshare

選擇性參數

--access-tier

特定共用的存取層。 GpV2 帳戶可以選擇 TransactionOptimized (預設)、經常性存取和非經常性存取。 檔案 儲存體 帳戶可以選擇 進階版。

接受的值: Cool, Hot, Premium, TransactionOptimized
--enabled-protocols

檔案共用通訊協定的不可變屬性。 NFS 通訊協定僅適用於進階檔案共用(檔案 儲存體 帳戶類型的檔案共用)。

接受的值: NFS, SMB
--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--metadata

與共用相關聯的空格分隔索引鍵=值組中的元數據。 這會覆寫任何現有的元數據。

--name -n

檔案共享名稱。

--quota -q

以 GB 為單位的共用大小上限。 必須大於 0,且小於或等於 5TB (5120)。 對於大型檔案共用,大小上限為 102400。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--root-squash

減少遠端超級使用者的訪問許可權。

接受的值: AllSquash, NoRootSquash, RootSquash
--storage-account

記憶體帳戶的名稱或識別碼。

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az storage share-rm stats

取得儲存在共享上的數據使用位元組。

az storage share-rm stats [--ids]
                          [--name]
                          [--resource-group]
                          [--storage-account]
                          [--subscription]

範例

取得儲存在共享上的數據使用位元組。

az storage share-rm stats -g MyResourceGroup --storage-account mystorageaccount --name myfileshare

選擇性參數

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--name -n

檔案共享名稱。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--storage-account

記憶體帳戶的名稱或識別碼。

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az storage share-rm update

更新 Azure 檔案共享的屬性。

az storage share-rm update [--access-tier {Cool, Hot, Premium, TransactionOptimized}]
                           [--add]
                           [--force-string]
                           [--ids]
                           [--metadata]
                           [--name]
                           [--quota]
                           [--remove]
                           [--resource-group]
                           [--root-squash {AllSquash, NoRootSquash, RootSquash}]
                           [--set]
                           [--storage-account]
                           [--subscription]

範例

在資源群組 'MyResourceGroup' 中的記憶體帳戶 'mystorageaccount' (帳戶名稱) 底下,更新 Azure 檔案共用 'myfileshare' 的屬性。

az storage share-rm update -g MyResourceGroup --storage-account mystorageaccount --name myfileshare --quota 3 --metadata key1=value1 key2=value2

更新記憶體帳戶 'mystorageaccount' 下 Azure 檔案共用 'myfileshare' 的屬性(帳戶標識符)。

az storage share-rm update --storage-account mystorageaccount --name myfileshare --quota 3 --metadata key1=value1 key2=value2

依資源標識碼更新 Azure 檔案共用的屬性。

az storage share-rm update --ids file-share-id --quota 3 --metadata key1=value1 key2=value2

選擇性參數

--access-tier

特定共用的存取層。 GpV2 帳戶可以選擇 TransactionOptimized (預設)、經常性存取和非經常性存取。 檔案 儲存體 帳戶可以選擇 進階版。

接受的值: Cool, Hot, Premium, TransactionOptimized
--add

藉由指定路徑和索引鍵值組,將物件加入物件清單。 範例:--add property.listProperty <key=value, string or JSON string>

預設值: []
--force-string

使用 'set' 或 'add' 時,請保留字串常值,而不是嘗試轉換成 JSON。

預設值: False
--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--metadata

與共用相關聯的空格分隔索引鍵=值組中的元數據。 這會覆寫任何現有的元數據。

--name -n

檔案共享名稱。

--quota -q

以 GB 為單位的共用大小上限。 必須大於 0,且小於或等於 5TB (5120)。 對於大型檔案共用,大小上限為 102400。

--remove

從清單中移除屬性或專案。 範例: --remove property.list <indexToRemove>--remove propertyToRemove

預設值: []
--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--root-squash

減少遠端超級使用者的訪問許可權。

接受的值: AllSquash, NoRootSquash, RootSquash
--set

指定要設定的屬性路徑和值,以更新物件。 範例:--set property1.property2=<value>

預設值: []
--storage-account

記憶體帳戶的名稱或識別碼。

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。