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

Defender For Storage - Create

在指定的存储帐户上创建或更新 Defender for Storage 设置。

PUT https://management.azure.com/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/current?api-version=2022-12-01-preview

URI 参数

名称 必需 类型 说明
resourceId
path True

string

资源的标识符。

settingName
path True

settingName

Defender for Storage 设置名称。

Regex pattern: ^[a-z][a-z0-9]*$

api-version
query True

string

操作的 API 版本

请求正文

名称 类型 说明
properties.isEnabled

boolean

指示是否在此存储帐户上启用了 Defender for Storage。

properties.malwareScanning.onUpload.capGBPerMonth

integer

定义每月要扫描的最大 GB。 如果不需要上限,则设置为 -1。

properties.malwareScanning.onUpload.isEnabled

boolean

指示是否应启用“上传时”恶意软件扫描。

properties.malwareScanning.scanResultsEventGridTopicResourceId

string

可选。 要向其发送扫描结果的事件网格主题的资源 ID。

properties.overrideSubscriptionLevelSettings

boolean

指示为此存储帐户定义的设置是否应替代为订阅定义的设置。

properties.sensitiveDataDiscovery.isEnabled

boolean

指示是否应启用敏感数据发现。

响应

名称 类型 说明
200 OK

DefenderForStorageSetting

成功请求创建或更新 Defender for Storage 设置。

201 Created

DefenderForStorageSetting

创建或更新 Defender for Storage 设置的请求部分成功。

Other Status Codes

CloudError

描述操作失败原因的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 流

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名称 说明
user_impersonation 模拟用户帐户

示例

Creates or updates the Defender for Storage settings on a specified resource.

Sample Request

PUT https://management.azure.com/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount/providers/Microsoft.Security/defenderForStorageSettings/current?api-version=2022-12-01-preview

{
  "properties": {
    "isEnabled": true,
    "malwareScanning": {
      "onUpload": {
        "isEnabled": true,
        "capGBPerMonth": -1
      },
      "scanResultsEventGridTopicResourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.EventGrid/topics/sampletopic"
    },
    "sensitiveDataDiscovery": {
      "isEnabled": true
    },
    "overrideSubscriptionLevelSettings": true
  }
}

Sample Response

{
  "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount/providers/Microsoft.Security/defenderForStorageSettings/current",
  "type": "Microsoft.Security/defenderForStorageSettings",
  "name": "current",
  "properties": {
    "isEnabled": true,
    "malwareScanning": {
      "onUpload": {
        "isEnabled": true,
        "capGBPerMonth": -1
      },
      "scanResultsEventGridTopicResourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.EventGrid/topics/sampletopic",
      "operationStatus": {
        "code": "Succeeded"
      }
    },
    "sensitiveDataDiscovery": {
      "isEnabled": true,
      "operationStatus": {
        "code": "Succeeded"
      }
    },
    "overrideSubscriptionLevelSettings": true
  }
}
{
  "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount/providers/Microsoft.Security/defenderForStorageSettings/current",
  "type": "Microsoft.Security/defenderForStorageSettings",
  "name": "current",
  "properties": {
    "isEnabled": true,
    "malwareScanning": {
      "onUpload": {
        "isEnabled": false,
        "capGBPerMonth": -1
      },
      "operationStatus": {
        "code": "UnknownError",
        "message": "Failed to setup data scanner."
      }
    },
    "sensitiveDataDiscovery": {
      "isEnabled": false,
      "operationStatus": {
        "code": "UnknownError",
        "message": "Failed to setup data scanner."
      }
    },
    "overrideSubscriptionLevelSettings": true
  }
}

定义

名称 说明
CloudError

对所有 Azure 资源管理器 API 的常见错误响应,可返回失败操作的错误详细信息。 (这也遵循 OData 错误响应格式.) 。

CloudErrorBody

错误详细信息。

DefenderForStorageSetting

Defender for Storage 资源。

ErrorAdditionalInfo

资源管理错误附加信息。

OperationStatus

描述启用/禁用操作成功/失败的状态。

settingName

Defender for Storage 设置名称。

CloudError

对所有 Azure 资源管理器 API 的常见错误响应,可返回失败操作的错误详细信息。 (这也遵循 OData 错误响应格式.) 。

名称 类型 说明
error.additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

error.code

string

错误代码。

error.details

CloudErrorBody[]

错误详细信息。

error.message

string

错误消息。

error.target

string

错误目标。

CloudErrorBody

错误详细信息。

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

CloudErrorBody[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

DefenderForStorageSetting

Defender for Storage 资源。

名称 类型 说明
id

string

资源 ID

name

string

资源名称

properties.isEnabled

boolean

指示是否在此存储帐户上启用了 Defender for Storage。

properties.malwareScanning.onUpload.capGBPerMonth

integer

定义每月要扫描的最大 GB。 如果不需要上限,则设置为 -1。

properties.malwareScanning.onUpload.isEnabled

boolean

指示是否应启用“上传时”恶意软件扫描。

properties.malwareScanning.operationStatus

OperationStatus

失败或部分成功时。 描述恶意软件扫描启用/禁用操作的其他数据。

properties.malwareScanning.scanResultsEventGridTopicResourceId

string

可选。 要向其发送扫描结果的事件网格主题的资源 ID。

properties.overrideSubscriptionLevelSettings

boolean

指示为此存储帐户定义的设置是否应替代为订阅定义的设置。

properties.sensitiveDataDiscovery.isEnabled

boolean

指示是否应启用敏感数据发现。

properties.sensitiveDataDiscovery.operationStatus

OperationStatus

失败或部分成功时。 描述敏感数据发现启用/禁用操作的其他数据。

type

string

资源类型

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

其他信息。

type

string

其他信息类型。

OperationStatus

描述启用/禁用操作成功/失败的状态。

名称 类型 说明
code

string

操作状态代码。

message

string

有关操作成功/失败的其他信息。

settingName

Defender for Storage 设置名称。

名称 类型 说明
current

string

Defender for Storage 设置名称的名称。