你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

az storage share-rm

使用 Microsoft.Storage 资源提供程序管理 Azure 文件共享。

命令

名称 说明 类型 Status
az storage share-rm create

根据请求正文所述,在指定帐户下创建新共享。 共享资源包括该共享的元数据和属性。 它不包括共享包含的文件列表。

核心 GA
az storage share-rm delete

删除指定的 Azure 文件共享或共享快照。

核心 GA
az storage share-rm exists

检查是否存在 Azure 文件共享。

核心 GA
az storage share-rm list

列出所有共享。

核心 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

根据请求正文所述,更新指定帐户下的新共享。 共享资源包括该共享的元数据和属性。 它不包括共享包含的文件列表。

核心 GA

az storage share-rm create

根据请求正文所述,在指定帐户下创建新共享。 共享资源包括该共享的元数据和属性。 它不包括共享包含的文件列表。

az storage share-rm create --account-name --storage-account
                           --name --share-name
                           [--access-tier {Cool, Hot, Premium, TransactionOptimized}]
                           [--bursting-max-mibps --paid-bursting-max-bandwidth-mibps]
                           [--enabled-protocols {NFS, SMB}]
                           [--metadata]
                           [--paid-bursting-enabled {0, 1, f, false, n, no, t, true, y, yes}]
                           [--paid-bursting-max-iops]
                           [--provisioned-bandwidth --provisioned-bandwidth-mibps]
                           [--provisioned-iops]
                           [--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”(帐户 ID)下创建一个新的 Azure 文件共享“myfileshare”,其元数据和配额为 10 GB。

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

在存储帐户“mystorageaccount”下创建新的 Azure 文件共享“myfileshare”,在资源组“MyResourceGroup”中启用 provisionedv2。

az storage account create -g res3376 --name sto328 --sku StandardV2_LRS --kind FileStorage
az storage share-rm create --storage-account sto328  -g res3376  -n share1 --provisioned-bandwidth-mibps 60 --provisioned-iops 500

必需参数

--account-name --storage-account

指定资源组中的存储帐户的名称。 存储帐户名称长度必须介于 3 到 24 个字符之间,并且仅使用数字和小写字母。

--name --share-name -n

指定存储帐户中的文件共享的名称。 文件共享名称长度必须介于 3 到 63 个字符之间,并且只能使用数字、小写字母和短划线(-)。 每个短划线(-)字符必须紧跟在字母或数字前面,后跟一个字母或数字。

可选参数

--access-tier

特定共享的访问层。 GpV2 帐户可以在 TransactionOptimized(默认)、热和冷之间进行选择。 FileStorage 帐户可以选择“高级”。

接受的值: Cool, Hot, Premium, TransactionOptimized
--bursting-max-mibps --paid-bursting-max-bandwidth-mibps

共享的最大付费突发带宽(以每秒兆字节为单位)。 此属性仅适用于在文件预配 v1 SSD 帐户类型下创建的文件共享。 允许的最大值为 10340,这是共享允许的最大带宽。

--enabled-protocols

用于文件共享的身份验证协议。 NFS 协议仅适用于高级文件共享(FileStorage 帐户类型的文件共享)。 只能在创建共享时指定。

接受的值: NFS, SMB
--metadata

要作为元数据与共享关联的名称/值对。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--paid-bursting-enabled

指示是否为共享启用了付费突发。 此属性仅适用于在文件预配 v1 SSD 帐户类型下创建的文件共享。

接受的值: 0, 1, f, false, n, no, t, true, y, yes
--paid-bursting-max-iops

共享的最大付费突发 IOPS。 此属性仅适用于在文件预配 v1 SSD 帐户类型下创建的文件共享。 允许的最大值为 102400,这是共享允许的最大 IOPS。

--provisioned-bandwidth --provisioned-bandwidth-mibps

共享的预配带宽(以每秒兆字节为单位)。 此属性仅适用于在文件预配 v2 帐户类型下创建的文件共享。 有关预配带宽的最小和允许的最大值,请参阅 GetFileServiceUsage API 响应。

--provisioned-iops

共享的预配 IOPS。 此属性仅适用于在文件预配 v2 帐户类型下创建的文件共享。 请参阅 GetFileServiceUsage API 响应,了解预配的 IOPS 的最小和允许的最大值。

--quota -q

共享的预配大小(以 gibibytes 为单位)。 必须大于 0,并且小于或等于 5TB (5120)。 对于大型文件共享,最大大小为 102400。 有关在文件预配 v2 帐户类型下创建的文件共享,请参阅 GetFileServiceUsage API 响应,了解允许的最小和最大预配存储大小。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

--root-squash

减少远程超级用户的访问权限。 该属性仅适用于 NFS 共享。 默认值为 NoRootSquash。

接受的值: 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

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

az storage share-rm delete

删除指定的 Azure 文件共享或共享快照。

删除指定的 Azure 文件共享或共享快照。 中断性变更:默认情况下无法删除快照,如果想要包括用于删除操作的 sanpshots,我们添加了要使用的新参数。

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

示例

删除资源组“MyResourceGroup”中的存储帐户“mystorageaccount”(帐户名称)下的 Azure 文件共享“myfileshare”。

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

删除存储帐户“mystorageaccount”(帐户 ID)下的 Azure 文件共享“myfileshare”。

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

按资源 ID 删除 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

可选参数

--account-name --storage-account

指定资源组中的存储帐户的名称。 存储帐户名称长度必须介于 3 到 24 个字符之间,并且仅使用数字和小写字母。

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

--include

可选。 有效值为:快照、租用快照、无。 默认值为 none。 对于“snapshots”,文件共享将被删除,包括其所有文件共享快照。 如果文件共享包含租约快照,则删除会失败。 对于“leased-snapshots”,文件共享将包括其所有文件共享快照(租用/未发布)。 对于“none”,如果文件共享没有共享快照,则会删除文件共享。 如果文件共享包含任何快照(已租用或未发布),则删除将失败。

默认值: none
--name --share-name -n

指定存储帐户中的文件共享的名称。 文件共享名称长度必须介于 3 到 63 个字符之间,并且只能使用数字、小写字母和短划线(-)。 每个短划线(-)字符必须紧跟在字母或数字前面,后跟一个字母或数字。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

--snapshot

可选,用于删除快照。指定要检索的共享快照的 DateTime 值。

--subscription

订阅的名称或 ID。 可以使用 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

订阅的名称或 ID。 可以使用 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”(帐户 ID)下是否存在 Azure 文件共享“myfileshare”。

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

按资源 ID 检查是否存在 Azure 文件共享。

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

可选参数

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

--name -n

文件共享名称。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

--storage-account

存储帐户的名称或 ID。

--subscription

订阅的名称或 ID。 可以使用 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

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

az storage share-rm list

列出所有共享。

az storage share-rm list --account-name --storage-account
                         [--filter]
                         [--include-deleted {0, 1, f, false, n, no, t, true, y, yes}]
                         [--include-snapshot {0, 1, f, false, n, no, t, true, y, yes}]
                         [--max-items]
                         [--maxpagesize]
                         [--next-token]
                         [--resource-group]

示例

列出资源组“MyResourceGroup”中存储帐户“mystorageaccount”(帐户名称)下的 Azure 文件共享。

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

列出存储帐户“mystorageaccount”(帐户 ID)下的 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

必需参数

--account-name --storage-account

指定资源组中的存储帐户的名称。 存储帐户名称长度必须介于 3 到 24 个字符之间,并且仅使用数字和小写字母。

可选参数

--filter

可选。 指定后,将仅列出以筛选器开头的共享名称。

--include-deleted

指定时包括软删除的文件共享。

接受的值: 0, 1, f, false, n, no, t, true, y, yes
--include-snapshot

指定时包括文件共享快照。

接受的值: 0, 1, f, false, n, no, t, true, y, yes
--max-items

命令输出中要返回的项总数。 如果可用的项总数大于指定的值,则会在命令的输出中提供令牌。 若要恢复分页,请在后续命令的 --next-token 参数中提供令牌值。

--maxpagesize

可选。 指定列表中可包含的最大共享数。

--next-token

用于指定开始分页的位置的令牌。 这是先前截断的响应中的令牌值。

--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

订阅的名称或 ID。 可以使用 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

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

--name -n

文件共享名称。 标识将还原的已删除共享的名称。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

--restored-name

要还原的新文件共享名称。 如果未指定,将使用已删除的共享名称。

--storage-account

存储帐户的名称或 ID。

--subscription

订阅的名称或 ID。 可以使用 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

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

az storage share-rm show

显示指定 Azure 文件共享或共享快照的属性。

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

示例

显示资源组“MyResourceGroup”中存储帐户“mystorageaccount”(帐户名称)下的 Azure 文件共享“myfileshare”的属性。

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

显示存储帐户“mystorageaccount”(帐户 ID)下 Azure 文件共享“myfileshare”的属性。

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

按资源 ID 显示 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"

可选参数

--account-name --storage-account

指定资源组中的存储帐户的名称。 存储帐户名称长度必须介于 3 到 24 个字符之间,并且仅使用数字和小写字母。

--expand

可选,用于扩展共享属性中的属性。 有效值为:已删除快照。 应作为带分隔符“,”的字符串传递。

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

--name --share-name -n

指定存储帐户中的文件共享的名称。 文件共享名称长度必须介于 3 到 63 个字符之间,并且只能使用数字、小写字母和短划线(-)。 每个短划线(-)字符必须紧跟在字母或数字前面,后跟一个字母或数字。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

--snapshot

可选,用于删除快照。指定要检索的共享快照的 DateTime 值。

--subscription

订阅的名称或 ID。 可以使用 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

订阅的名称或 ID。 可以使用 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(默认)、热和冷之间进行选择。 FileStorage 帐户可以选择“高级”。

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

文件共享协议的不可变属性。 NFS 协议仅适用于高级文件共享(FileStorage 帐户类型的文件共享)。

接受的值: NFS, SMB
--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

--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

存储帐户的名称或 ID。

--subscription

订阅的名称或 ID。 可以使用 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

订阅的名称或 ID。 可以使用 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

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

--name -n

文件共享名称。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

--storage-account

存储帐户的名称或 ID。

--subscription

订阅的名称或 ID。 可以使用 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

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

az storage share-rm update

根据请求正文所述,更新指定帐户下的新共享。 共享资源包括该共享的元数据和属性。 它不包括共享包含的文件列表。

az storage share-rm update [--access-tier {Cool, Hot, Premium, TransactionOptimized}]
                           [--account-name --storage-account]
                           [--add]
                           [--bursting-max-mibps --paid-bursting-max-bandwidth-mibps]
                           [--force-string {0, 1, f, false, n, no, t, true, y, yes}]
                           [--ids]
                           [--metadata]
                           [--name --share-name]
                           [--paid-bursting-enabled {0, 1, f, false, n, no, t, true, y, yes}]
                           [--paid-bursting-max-iops]
                           [--provisioned-bandwidth --provisioned-bandwidth-mibps]
                           [--provisioned-iops]
                           [--quota]
                           [--remove]
                           [--resource-group]
                           [--root-squash {AllSquash, NoRootSquash, RootSquash}]
                           [--set]
                           [--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”(帐户 ID)下 Azure 文件共享“myfileshare”的属性。

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

按资源 ID 更新 Azure 文件共享的属性。

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

可选参数

--access-tier

特定共享的访问层。 GpV2 帐户可以在 TransactionOptimized(默认)、热和冷之间进行选择。 FileStorage 帐户可以选择“高级”。

接受的值: Cool, Hot, Premium, TransactionOptimized
--account-name --storage-account

指定资源组中的存储帐户的名称。 存储帐户名称长度必须介于 3 到 24 个字符之间,并且仅使用数字和小写字母。

--add

通过指定路径和键值对将对象添加到对象列表。 示例:--add property.listProperty <key=value, string or JSON string>

--bursting-max-mibps --paid-bursting-max-bandwidth-mibps

共享的最大付费突发带宽(以每秒兆字节为单位)。 此属性仅适用于在文件预配 v1 SSD 帐户类型下创建的文件共享。 允许的最大值为 10340,这是共享允许的最大带宽。

--force-string

使用“set”或“add”时,保留字符串文本,而不是尝试转换为 JSON。

接受的值: 0, 1, f, false, n, no, t, true, y, yes
--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

--metadata

要作为元数据与共享关联的名称/值对。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--name --share-name -n

指定存储帐户中的文件共享的名称。 文件共享名称长度必须介于 3 到 63 个字符之间,并且只能使用数字、小写字母和短划线(-)。 每个短划线(-)字符必须紧跟在字母或数字前面,后跟一个字母或数字。

--paid-bursting-enabled

指示是否为共享启用了付费突发。 此属性仅适用于在文件预配 v1 SSD 帐户类型下创建的文件共享。

接受的值: 0, 1, f, false, n, no, t, true, y, yes
--paid-bursting-max-iops

共享的最大付费突发 IOPS。 此属性仅适用于在文件预配 v1 SSD 帐户类型下创建的文件共享。 允许的最大值为 102400,这是共享允许的最大 IOPS。

--provisioned-bandwidth --provisioned-bandwidth-mibps

共享的预配带宽(以每秒兆字节为单位)。 此属性仅适用于在文件预配 v2 帐户类型下创建的文件共享。 有关预配带宽的最小和允许的最大值,请参阅 GetFileServiceUsage API 响应。

--provisioned-iops

共享的预配 IOPS。 此属性仅适用于在文件预配 v2 帐户类型下创建的文件共享。 请参阅 GetFileServiceUsage API 响应,了解预配的 IOPS 的最小和允许的最大值。

--quota -q

共享的预配大小(以 gibibytes 为单位)。 必须大于 0,并且小于或等于 5TB (5120)。 对于大型文件共享,最大大小为 102400。 有关在文件预配 v2 帐户类型下创建的文件共享,请参阅 GetFileServiceUsage API 响应,了解允许的最小和最大预配存储大小。

--remove

从列表中删除属性或元素。 示例: --remove property.list <indexToRemove> OR --remove propertyToRemove.

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

--root-squash

减少远程超级用户的访问权限。 该属性仅适用于 NFS 共享。 默认值为 NoRootSquash。

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

通过指定要设置的属性路径和值来更新对象。 示例:--set property1.property2=<value>

--subscription

订阅的名称或 ID。 可以使用 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

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。