你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Microsoft.Storage storage storageAccounts/blobServices
Bicep 资源定义
可以使用面向以下操作部署 storageAccounts/blobServices 资源类型:
- 资源组 - 请参阅 资源组部署命令
有关每个 API 版本中已更改属性的列表,请参阅 更改日志。
资源格式
若要创建 Microsoft.Storage/storageAccounts/blobServices 资源,请将以下 Bicep 添加到模板。
resource symbolicname 'Microsoft.Storage/storageAccounts/blobServices@2023-01-01' = {
name: 'default'
parent: resourceSymbolicName
properties: {
automaticSnapshotPolicyEnabled: bool
changeFeed: {
enabled: bool
retentionInDays: int
}
containerDeleteRetentionPolicy: {
allowPermanentDelete: bool
days: int
enabled: bool
}
cors: {
corsRules: [
{
allowedHeaders: [
'string'
]
allowedMethods: [
'string'
]
allowedOrigins: [
'string'
]
exposedHeaders: [
'string'
]
maxAgeInSeconds: int
}
]
}
defaultServiceVersion: 'string'
deleteRetentionPolicy: {
allowPermanentDelete: bool
days: int
enabled: bool
}
isVersioningEnabled: bool
lastAccessTimeTrackingPolicy: {
blobType: [
'string'
]
enable: bool
name: 'AccessTimeTracking'
trackingGranularityInDays: int
}
restorePolicy: {
days: int
enabled: bool
}
}
}
属性值
storageAccounts/blobServices
名称 | 说明 | 值 |
---|---|---|
name | 资源名称 了解如何在 Bicep 中设置子资源的名称和类型。 |
'default' |
父级 (parent) | 在 Bicep 中,可以为子资源指定父资源。 仅当子资源在父资源外部声明时,才需要添加此属性。 有关详细信息,请参阅 父资源之外的子资源。 |
类型为的资源的符号名称: storageAccounts |
properties | 存储帐户的 Blob 服务的属性。 | BlobServicePropertiesProperties |
BlobServicePropertiesProperties
名称 | 说明 | 值 |
---|---|---|
automaticSnapshotPolicyEnabled | 弃用了 isVersioningEnabled 属性。 | bool |
changeFeed | 更改源事件的 Blob 服务属性。 | ChangeFeed |
containerDeleteRetentionPolicy | 容器软删除的 Blob 服务属性。 | DeleteRetentionPolicy |
cors | 指定 Blob 服务的 CORS 规则。 最多可以在请求中包含五个 CorsRule 元素。 如果请求正文中不包含 CorsRule 元素,则将删除所有 CORS 规则,并且将为 Blob 服务禁用 CORS。 | CorsRules |
defaultServiceVersion | 如果未指定传入请求的版本,DefaultServiceVersion 指示用于对 Blob 服务的请求的默认版本。 可取的值包括 2008-10-27 版和所有更新的版本。 | 字符串 |
deleteRetentionPolicy | Blob 软删除的 Blob 服务属性。 | DeleteRetentionPolicy |
isVersioningEnabled | 如果设置为 true,则启用版本控制。 | bool |
lastAccessTimeTrackingPolicy | 用于配置基于上次访问时间的跟踪策略的 Blob 服务属性。 | LastAccessTimeTrackingPolicy |
restorePolicy | Blob 还原策略的 Blob 服务属性。 | RestorePolicyProperties |
ChangeFeed
名称 | 说明 | 值 |
---|---|---|
enabled | 指示是否为 Blob 服务启用更改源事件日志记录。 | bool |
retentionInDays | 指示 changeFeed 保留的持续时间(以天为单位)。 最小值为 1 天,最大值为 146000 天 (400 年) 。 null 值表示更改源的无限保留期。 | int 约束: 最小值 = 1 最大值 = 146000 |
DeleteRetentionPolicy
名称 | 说明 | 值 |
---|---|---|
allowPermanentDelete | 设置为 true 时,此属性允许删除软删除的 Blob 版本和快照。 此属性不能用于 Blob 还原策略。 此属性仅适用于 Blob 服务,不适用于容器或文件共享。 | bool |
days | 指示已删除项应保留的天数。 指定的最小值可以是 1,最大值可以是 365。 | int 约束: 最小值 = 1 最大值 = 365 |
enabled | 指示是否启用 DeleteRetentionPolicy。 | bool |
CorsRules
名称 | 说明 | 值 |
---|---|---|
corsRules | CORS 规则列表。 最多可以在请求中包含五个 CorsRule 元素。 | CorsRule[] |
CorsRule
名称 | 说明 | 值 |
---|---|---|
allowedHeaders | 如果存在 CorsRule 元素,则为必需项。 允许作为跨域请求一部分的标头列表。 | string[] (必需的) |
allowedMethods | 如果存在 CorsRule 元素,则为必需项。 源允许执行的 HTTP 方法的列表。 | 包含任意项的字符串数组: “CONNECT” “DELETE” “GET” “HEAD” 'MERGE' “OPTIONS” “PATCH” “POST” “PUT” “TRACE” (必需的) |
allowedOrigins | 如果存在 CorsRule 元素,则为必需项。 将允许通过 CORS 或“*”允许所有域的源域列表 | string[] (必需的) |
exposedHeaders | 如果存在 CorsRule 元素,则为必需项。 要向 CORS 客户端公开的响应标头列表。 | string[] (必需的) |
maxAgeInSeconds | 如果存在 CorsRule 元素,则为必需项。 客户端/浏览器应缓存预检响应的秒数。 | int (必需) |
LastAccessTimeTrackingPolicy
名称 | 说明 | 值 |
---|---|---|
blobType | 预定义支持的 Blob 类型的数组。 只有 blockBlob 是受支持的值。 此字段当前为只读 | string[] |
enable | 如果设置为 true,则启用基于上次访问时间的跟踪。 | bool (必需) |
name | 策略的名称。 有效值为 AccessTimeTracking。 此字段当前为只读 | “AccessTimeTracking” |
trackingGranularityInDays | 字段指定 Blob 对象跟踪粒度(以天为单位),通常应跟踪 Blob 对象的频率。此字段当前为只读,值为 1 | int |
RestorePolicyProperties
名称 | 说明 | 值 |
---|---|---|
days | 此 Blob 可以还原多长时间。 它应大于零,小于 DeleteRetentionPolicy.days。 | int 约束: 最小值 = 1 最大值 = 365 |
enabled | 如果设置为 true,则启用 Blob 还原。 | bool (必需) |
快速入门模板
以下快速入门模板部署此资源类型。
模板 | 说明 |
---|---|
Azure Cloud Shell - VNet 存储 |
此模板将 Azure Cloud Shell存储部署到 Azure 虚拟网络中。 |
创建 Azure 机器学习扫描作业 |
此模板创建用于超参数优化的 Azure 机器学习扫描作业。 |
具有 SSE 和 Blob 删除保留策略的存储帐户 |
此模板创建具有存储服务加密和 Blob 删除保留策略的存储帐户 |
ARM 模板资源定义
storageAccounts/blobServices 资源类型可以使用面向以下对象的操作进行部署:
- 资源组 - 请参阅 资源组部署命令
有关每个 API 版本中更改的属性的列表,请参阅 更改日志。
资源格式
若要创建 Microsoft.Storage/storageAccounts/blobServices 资源,请将以下 JSON 添加到模板。
{
"type": "Microsoft.Storage/storageAccounts/blobServices",
"apiVersion": "2023-01-01",
"name": "default",
"properties": {
"automaticSnapshotPolicyEnabled": "bool",
"changeFeed": {
"enabled": "bool",
"retentionInDays": "int"
},
"containerDeleteRetentionPolicy": {
"allowPermanentDelete": "bool",
"days": "int",
"enabled": "bool"
},
"cors": {
"corsRules": [
{
"allowedHeaders": [ "string" ],
"allowedMethods": [ "string" ],
"allowedOrigins": [ "string" ],
"exposedHeaders": [ "string" ],
"maxAgeInSeconds": "int"
}
]
},
"defaultServiceVersion": "string",
"deleteRetentionPolicy": {
"allowPermanentDelete": "bool",
"days": "int",
"enabled": "bool"
},
"isVersioningEnabled": "bool",
"lastAccessTimeTrackingPolicy": {
"blobType": [ "string" ],
"enable": "bool",
"name": "AccessTimeTracking",
"trackingGranularityInDays": "int"
},
"restorePolicy": {
"days": "int",
"enabled": "bool"
}
}
}
属性值
storageAccounts/blobServices
名称 | 说明 | Value |
---|---|---|
type | 资源类型 | “Microsoft.Storage/storageAccounts/blobServices” |
apiVersion | 资源 API 版本 | '2023-01-01' |
name | 资源名称 了解如何在 JSON ARM 模板中设置子资源的名称和类型。 |
'default' |
properties | 存储帐户的 Blob 服务的属性。 | BlobServicePropertiesProperties |
BlobServicePropertiesProperties
名称 | 说明 | 值 |
---|---|---|
automaticSnapshotPolicyEnabled | 弃用了 isVersioningEnabled 属性。 | bool |
changeFeed | 更改源事件的 Blob 服务属性。 | ChangeFeed |
containerDeleteRetentionPolicy | 容器软删除的 Blob 服务属性。 | DeleteRetentionPolicy |
cors | 指定 Blob 服务的 CORS 规则。 最多可以在请求中包含五个 CorsRule 元素。 如果请求正文中不包含 CorsRule 元素,则将删除所有 CORS 规则,并且将为 Blob 服务禁用 CORS。 | CorsRules |
defaultServiceVersion | 如果未指定传入请求的版本,DefaultServiceVersion 指示用于对 Blob 服务的请求的默认版本。 可取的值包括 2008-10-27 版和所有更新的版本。 | 字符串 |
deleteRetentionPolicy | Blob 软删除的 Blob 服务属性。 | DeleteRetentionPolicy |
isVersioningEnabled | 如果设置为 true,则启用版本控制。 | bool |
lastAccessTimeTrackingPolicy | 用于配置基于上次访问时间的跟踪策略的 Blob 服务属性。 | LastAccessTimeTrackingPolicy |
restorePolicy | Blob 还原策略的 Blob 服务属性。 | RestorePolicyProperties |
ChangeFeed
名称 | 说明 | 值 |
---|---|---|
enabled | 指示是否为 Blob 服务启用更改源事件日志记录。 | bool |
retentionInDays | 指示 changeFeed 保留的持续时间(以天为单位)。 最小值为 1 天,最大值为 146000 天 (400 年) 。 null 值表示更改源的无限保留期。 | int 约束: 最小值 = 1 最大值 = 146000 |
DeleteRetentionPolicy
名称 | 说明 | 值 |
---|---|---|
allowPermanentDelete | 设置为 true 时,此属性允许删除软删除的 Blob 版本和快照。 此属性不能用于 Blob 还原策略。 此属性仅适用于 Blob 服务,不适用于容器或文件共享。 | bool |
days | 指示已删除项应保留的天数。 指定的最小值可以是 1,最大值可以是 365。 | int 约束: 最小值 = 1 最大值 = 365 |
enabled | 指示是否启用 DeleteRetentionPolicy。 | bool |
CorsRules
名称 | 说明 | 值 |
---|---|---|
corsRules | CORS 规则列表。 最多可以在请求中包含五个 CorsRule 元素。 | CorsRule[] |
CorsRule
名称 | 说明 | 值 |
---|---|---|
allowedHeaders | 如果存在 CorsRule 元素,则为必需项。 允许作为跨域请求一部分的标头列表。 | string[] (必需的) |
allowedMethods | 如果存在 CorsRule 元素,则为必需项。 源允许执行的 HTTP 方法的列表。 | 包含任意项的字符串数组: “CONNECT” “DELETE” “GET” “HEAD” 'MERGE' “OPTIONS” “PATCH” “POST” “PUT” “TRACE” (必需的) |
allowedOrigins | 如果存在 CorsRule 元素,则为必需项。 将允许通过 CORS 或“*”允许所有域的源域列表 | string[] (必需的) |
exposedHeaders | 如果存在 CorsRule 元素,则为必需项。 要向 CORS 客户端公开的响应标头列表。 | string[] (必需的) |
maxAgeInSeconds | 如果存在 CorsRule 元素,则为必需项。 客户端/浏览器应缓存预检响应的秒数。 | int (必需) |
LastAccessTimeTrackingPolicy
名称 | 说明 | 值 |
---|---|---|
blobType | 预定义支持的 Blob 类型的数组。 只有 blockBlob 是受支持的值。 此字段当前为只读 | string[] |
enable | 如果设置为 true,则启用基于上次访问时间的跟踪。 | bool (必需) |
name | 策略的名称。 有效值为 AccessTimeTracking。 此字段当前为只读 | “AccessTimeTracking” |
trackingGranularityInDays | 字段指定 Blob 对象跟踪粒度(以天为单位),通常应跟踪 Blob 对象的频率。此字段当前为只读,值为 1 | int |
RestorePolicyProperties
名称 | 说明 | 值 |
---|---|---|
days | 此 Blob 可以还原多长时间。 它应大于零,小于 DeleteRetentionPolicy.days。 | int 约束: 最小值 = 1 最大值 = 365 |
enabled | 如果设置为 true,则启用 Blob 还原。 | bool (必需) |
快速入门模板
以下快速入门模板部署此资源类型。
模板 | 说明 |
---|---|
Azure Cloud Shell - VNet 存储 |
此模板将 Azure Cloud Shell存储部署到 Azure 虚拟网络中。 |
创建 Azure 机器学习扫描作业 |
此模板创建用于超参数优化的 Azure 机器学习扫描作业。 |
具有 SSE 和 Blob 删除保留策略的存储帐户 |
此模板创建具有存储服务加密和 Blob 删除保留策略的存储帐户 |
Terraform (AzAPI 提供程序) 资源定义
storageAccounts/blobServices 资源类型可以使用面向以下对象的操作进行部署:
- 资源组
有关每个 API 版本中更改的属性的列表,请参阅 更改日志。
资源格式
若要创建 Microsoft.Storage/storageAccounts/blobServices 资源,请将以下 Terraform 添加到模板。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Storage/storageAccounts/blobServices@2023-01-01"
name = "default"
parent_id = "string"
body = jsonencode({
properties = {
automaticSnapshotPolicyEnabled = bool
changeFeed = {
enabled = bool
retentionInDays = int
}
containerDeleteRetentionPolicy = {
allowPermanentDelete = bool
days = int
enabled = bool
}
cors = {
corsRules = [
{
allowedHeaders = [
"string"
]
allowedMethods = [
"string"
]
allowedOrigins = [
"string"
]
exposedHeaders = [
"string"
]
maxAgeInSeconds = int
}
]
}
defaultServiceVersion = "string"
deleteRetentionPolicy = {
allowPermanentDelete = bool
days = int
enabled = bool
}
isVersioningEnabled = bool
lastAccessTimeTrackingPolicy = {
blobType = [
"string"
]
enable = bool
name = "AccessTimeTracking"
trackingGranularityInDays = int
}
restorePolicy = {
days = int
enabled = bool
}
}
})
}
属性值
storageAccounts/blobServices
名称 | 说明 | Value |
---|---|---|
type | 资源类型 | “Microsoft.Storage/storageAccounts/blobServices@2023-01-01” |
name | 资源名称 | "default" |
parent_id | 此资源的父资源 ID。 | 类型为:storageAccounts 的资源的 ID |
properties | 存储帐户的 Blob 服务的属性。 | BlobServicePropertiesProperties |
BlobServicePropertiesProperties
名称 | 说明 | 值 |
---|---|---|
automaticSnapshotPolicyEnabled | 弃用,改用 isVersioningEnabled 属性。 | bool |
changeFeed | 更改源事件的 Blob 服务属性。 | ChangeFeed |
containerDeleteRetentionPolicy | 容器软删除的 Blob 服务属性。 | DeleteRetentionPolicy |
cors | 指定 Blob 服务的 CORS 规则。 最多可以在请求中包含五个 CorsRule 元素。 如果请求正文中不包含 CorsRule 元素,则将删除所有 CORS 规则,并且将禁用 Blob 服务的 CORS。 | CorsRules |
defaultServiceVersion | 如果未指定传入请求的版本,则 DefaultServiceVersion 指示用于对 Blob 服务的请求的默认版本。 可取的值包括 2008-10-27 版和所有更新的版本。 | 字符串 |
deleteRetentionPolicy | Blob 软删除的 Blob 服务属性。 | DeleteRetentionPolicy |
isVersioningEnabled | 如果设置为 true,则启用版本控制。 | bool |
lastAccessTimeTrackingPolicy | 用于配置基于上次访问时间的跟踪策略的 Blob 服务属性。 | LastAccessTimeTrackingPolicy |
restorePolicy | Blob 还原策略的 Blob 服务属性。 | RestorePolicyProperties |
ChangeFeed
名称 | 说明 | 值 |
---|---|---|
enabled | 指示是否为 Blob 服务启用更改源事件日志记录。 | bool |
retentionInDays | 指示 changeFeed 保留期(以天为单位)。 最小值为 1 天,最大值为 146000 天, (400 年) 。 null 值表示更改源的无限保留期。 | int 约束: 最小值 = 1 最大值 = 146000 |
DeleteRetentionPolicy
名称 | 说明 | 值 |
---|---|---|
allowPermanentDelete | 设置为 true 时,此属性允许删除软删除的 Blob 版本和快照。 此属性不能用于 Blob 还原策略。 此属性仅适用于 Blob 服务,不适用于容器或文件共享。 | bool |
days | 指示已删除项应保留的天数。 指定的最小值可以为 1,最大值可以为 365。 | int 约束: 最小值 = 1 最大值 = 365 |
enabled | 指示是否启用 DeleteRetentionPolicy。 | bool |
CorsRules
名称 | 说明 | 值 |
---|---|---|
corsRules | CORS 规则列表。 最多可以在请求中包含五个 CorsRule 元素。 | CorsRule[] |
CorsRule
名称 | 说明 | 值 |
---|---|---|
allowedHeaders | 如果存在 CorsRule 元素,则为必需项。 允许作为跨域请求一部分的标头列表。 | string[] (必需的) |
allowedMethods | 如果存在 CorsRule 元素,则为必需项。 源允许执行的 HTTP 方法的列表。 | 包含任意项的字符串数组: “CONNECT” "DELETE" "GET" "HEAD" “MERGE” “OPTIONS” "PATCH" “POST” "PUT" “TRACE” (必需) |
allowedOrigins | 如果存在 CorsRule 元素,则为必需项。 将允许通过 CORS 或“*”允许所有域的源域列表 | string[] (必需的) |
exposedHeaders | 如果存在 CorsRule 元素,则为必需项。 要向 CORS 客户端公开的响应标头列表。 | string[] (必需) |
maxAgeInSeconds | 如果存在 CorsRule 元素,则为必需项。 客户端/浏览器应缓存预检响应的秒数。 | int (必需) |
LastAccessTimeTrackingPolicy
名称 | 说明 | 值 |
---|---|---|
blobType | 预定义支持的 Blob 类型的数组。 仅 blockBlob 是受支持的值。 此字段当前为只读 | string[] |
enable | 当设置为 true 时,将启用基于上次访问时间的跟踪。 | 需要 bool () |
name | 策略的名称。 有效值为 AccessTimeTracking。 此字段当前为只读 | “AccessTimeTracking” |
trackingGranularityInDays | 字段指定 Blob 对象跟踪粒度(以天为单位),通常应跟踪 Blob 对象的频率。此字段当前为只读,值为 1 | int |
RestorePolicyProperties
名称 | 说明 | 值 |
---|---|---|
days | 此 Blob 可以还原多长时间。 它应大于零且小于 DeleteRetentionPolicy.days。 | int 约束: 最小值 = 1 最大值 = 365 |
enabled | 如果设置为 true,则启用 Blob 还原。 | 需要 bool () |
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈