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

az storage blob service-properties

注意

此命令组具有在 Azure CLI 和至少一个扩展中定义的命令。 安装每个扩展,使其受益于其扩展功能。 详细了解扩展。

管理存储 blob 服务属性。

命令

名称 说明 类型 状态
az storage blob service-properties delete-policy

管理存储 blob delete-policy 服务属性。

核心 GA
az storage blob service-properties delete-policy show

显示存储 blob 删除策略。

核心 GA
az storage blob service-properties delete-policy update

更新存储 Blob 删除策略。

核心 GA
az storage blob service-properties show

获取存储帐户的 Blob 服务的属性,包括Azure 存储分析。

核心 GA
az storage blob service-properties update

更新存储 blob 服务属性。

核心 GA
az storage blob service-properties update (storage-blob-preview 扩展)

更新存储 blob 服务属性。

扩展 GA

az storage blob service-properties show

获取存储帐户的 Blob 服务的属性,包括Azure 存储分析。

:关键字 (keyword) int timeout:设置操作的服务器端超时(以秒为单位)。 有关详细信息,请参阅 https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-blob-service-operations 。 不会在客户端上跟踪或验证此值。 若要配置客户端网络超时,请参阅 here <https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-blob #other-client--per-operation-configuration>_。 :returns:包含 Blob 服务属性的对象,例如分析日志记录、小时/分钟指标、cors 规则等。:rtype: Dict[str, Any] .. admonition:: 示例: .. literalinclude:: ../samples/blob_samples_service.py :start-after: [START get_blob_service_properties] :end-before: [END get_blob_service_properties] :language: python :d edent: 8 :描述文字: 获取 blob 服务的服务属性。

az storage blob service-properties show [--account-key]
                                        [--account-name]
                                        [--auth-mode {key, login}]
                                        [--blob-endpoint]
                                        [--connection-string]
                                        [--sas-token]

可选参数

--account-key

存储帐户密钥。 必须与存储帐户名称或服务终结点结合使用。 环境变量:AZURE_STORAGE_KEY。

--account-name

存储帐户名称。 相关环境变量:AZURE_STORAGE_ACCOUNT。 必须与存储帐户密钥或 SAS 令牌结合使用。 如果两者都不存在,该命令将尝试使用经过身份验证的 Azure 帐户查询存储帐户密钥。 如果执行了大量存储命令,可能会命中 API 配额。

--auth-mode

运行命令的模式。 “登录”模式将直接使用登录凭据进行身份验证。 如果未提供帐户的身份验证参数,则旧版“密钥”模式将尝试查询帐户密钥。 环境变量:AZURE_STORAGE_AUTH_MODE。

接受的值: key, login
--blob-endpoint

存储数据服务终结点。 必须与存储帐户密钥或 SAS 令牌结合使用。 可以使用 .. 查找每个服务主终结点 az storage account show。 环境变量:AZURE_STORAGE_标准版RVICE_ENDPOINT。

--connection-string

存储帐户连接字符串。 环境变量:AZURE_STORAGE_CONNECTION_STRING。

--sas-token

共享访问签名(SAS)。 必须与存储帐户名称或服务终结点结合使用。 环境变量:AZURE_STORAGE_SAS_TOKEN。

全局参数
--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 blob service-properties update

更新存储 blob 服务属性。

az storage blob service-properties update [--404-document]
                                          [--account-key]
                                          [--account-name]
                                          [--add]
                                          [--auth-mode {key, login}]
                                          [--blob-endpoint]
                                          [--connection-string]
                                          [--delete-retention {false, true}]
                                          [--delete-retention-period]
                                          [--force-string]
                                          [--index-document]
                                          [--remove]
                                          [--sas-token]
                                          [--set]
                                          [--static-website {false, true}]

示例

更新存储 blob 服务属性。 (自动生成)

az storage blob service-properties update --404-document error.html --account-name mystorageccount --account-key 00000000 --index-document index.html --static-website true

可选参数

--404-document

表示在发出错误 404 时,当浏览器请求不存在的页面时,应显示的错误文档的路径。

--account-key

存储帐户密钥。 必须与存储帐户名称或服务终结点结合使用。 环境变量:AZURE_STORAGE_KEY。

--account-name

存储帐户名称。 相关环境变量:AZURE_STORAGE_ACCOUNT。 必须与存储帐户密钥或 SAS 令牌结合使用。 如果两者都不存在,该命令将尝试使用经过身份验证的 Azure 帐户查询存储帐户密钥。 如果执行了大量存储命令,可能会命中 API 配额。

--add

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

默认值: []
--auth-mode

运行命令的模式。 “登录”模式将直接使用登录凭据进行身份验证。 如果未提供帐户的身份验证参数,则旧版“密钥”模式将尝试查询帐户密钥。 环境变量:AZURE_STORAGE_AUTH_MODE。

接受的值: key, login
--blob-endpoint

存储数据服务终结点。 必须与存储帐户密钥或 SAS 令牌结合使用。 可以使用 .. 查找每个服务主终结点 az storage account show。 环境变量:AZURE_STORAGE_标准版RVICE_ENDPOINT。

--connection-string

存储帐户连接字符串。 环境变量:AZURE_STORAGE_CONNECTION_STRING。

--delete-retention

启用软删除。

接受的值: false, true
--delete-retention-period

将保留软删除 Blob 的天数。 必须位于 [1,365] 范围内。

--force-string

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

默认值: False
--index-document

表示索引文档的名称。 这通常是“index.html”。

--remove

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

默认值: []
--sas-token

共享访问签名(SAS)。 必须与存储帐户名称或服务终结点结合使用。 环境变量:AZURE_STORAGE_SAS_TOKEN。

--set

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

默认值: []
--static-website

启用静态网站。

接受的值: false, true
全局参数
--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 blob service-properties update (storage-blob-preview 扩展)

更新存储 blob 服务属性。

az storage blob service-properties update [--404-document]
                                          [--account-key]
                                          [--account-name]
                                          [--auth-mode {key, login}]
                                          [--blob-endpoint]
                                          [--connection-string]
                                          [--default-index-path]
                                          [--delete-retention {false, true}]
                                          [--delete-retention-period]
                                          [--index-document]
                                          [--sas-token]
                                          [--static-website {false, true}]
                                          [--timeout]

示例

更新存储 blob 服务属性。 (自动生成)

az storage blob service-properties update --404-document error.html --account-name mystorageccount --account-key 00000000 --index-document index.html --static-website true

可选参数

--404-document

自定义 404 页面的绝对路径。

--account-key

存储帐户密钥。 必须与存储帐户名称结合使用。 环境变量:AZURE_STORAGE_KEY。

--account-name

存储帐户名称。 相关环境变量:AZURE_STORAGE_ACCOUNT。 必须与存储帐户密钥或 SAS 令牌结合使用。 如果两者都不存在,该命令将尝试使用经过身份验证的 Azure 帐户查询存储帐户密钥。 如果执行了大量存储命令,可能会命中 API 配额。

--auth-mode

运行命令的模式。 “登录”模式将直接使用登录凭据进行身份验证。 如果未提供帐户的身份验证参数,则旧版“密钥”模式将尝试查询帐户密钥。 环境变量:AZURE_STORAGE_AUTH_MODE。

接受的值: key, login
--blob-endpoint

存储数据服务终结点。 必须与存储帐户密钥或 SAS 令牌结合使用。 可以使用 .. 查找每个服务主终结点 az storage account show。 环境变量:AZURE_STORAGE_标准版RVICE_ENDPOINT。

--connection-string

存储帐户连接字符串。 环境变量:AZURE_STORAGE_CONNECTION_STRING。

--default-index-path
预览

默认索引页的绝对路径。

--delete-retention

启用软删除。

接受的值: false, true
--delete-retention-period

将保留软删除 Blob 的天数。 必须位于 [1,365] 范围内。

--index-document

每个目录下索引页的默认名称。

--sas-token

共享访问签名(SAS)。 必须与存储帐户名称结合使用。 环境变量:AZURE_STORAGE_SAS_TOKEN。

--static-website

启用静态网站。

接受的值: false, true
--timeout

请求超时(以秒为单位)。 适用于对服务的每个调用。

全局参数
--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 获取完整的调试日志。