Defender For Storage - Create
Creates or updates the Defender for Storage settings on a specified storage account.
PUT https://management.azure.com/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/current?api-version=2022-12-01-preview
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
resource
|
path | True |
string |
The identifier of the resource. |
setting
|
path | True |
Defender for Storage setting name. Regex pattern: |
|
api-version
|
query | True |
string |
API version for the operation |
Request Body
Name | Type | Description |
---|---|---|
properties |
Defender for Storage resource properties. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
Successful request to create or update Defender for Storage settings. |
|
201 Created |
Request to create or update Defender for Storage settings partially succeeded. |
|
Other Status Codes |
Error response describing why the operation failed. |
Security
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name | Description |
---|---|
user_impersonation | impersonate your user account |
Examples
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
}
}
Definitions
Name | Description |
---|---|
Cloud |
Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). |
Cloud |
The error detail. |
Defender |
The Defender for Storage resource. |
Defender |
Defender for Storage resource properties. |
Error |
The resource management error additional info. |
Malware |
Properties of Malware Scanning. |
On |
Properties of On Upload malware scanning. |
Operation |
A status describing the success/failure of the enablement/disablement operation. |
Sensitive |
Properties of Sensitive Data Discovery. |
setting |
Defender for Storage setting name. |
CloudError
Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).
Name | Type | Description |
---|---|---|
error.additionalInfo |
The error additional info. |
|
error.code |
string |
The error code. |
error.details |
The error details. |
|
error.message |
string |
The error message. |
error.target |
string |
The error target. |
CloudErrorBody
The error detail.
Name | Type | Description |
---|---|---|
additionalInfo |
The error additional info. |
|
code |
string |
The error code. |
details |
The error details. |
|
message |
string |
The error message. |
target |
string |
The error target. |
DefenderForStorageSetting
The Defender for Storage resource.
Name | Type | Description |
---|---|---|
id |
string |
Resource Id |
name |
string |
Resource name |
properties |
Defender for Storage resource properties. |
|
type |
string |
Resource type |
DefenderForStorageSettingProperties
Defender for Storage resource properties.
Name | Type | Description |
---|---|---|
isEnabled |
boolean |
Indicates whether Defender for Storage is enabled on this storage account. |
malwareScanning |
Properties of Malware Scanning. |
|
overrideSubscriptionLevelSettings |
boolean |
Indicates whether the settings defined for this storage account should override the settings defined for the subscription. |
sensitiveDataDiscovery |
Properties of Sensitive Data Discovery. |
ErrorAdditionalInfo
The resource management error additional info.
Name | Type | Description |
---|---|---|
info |
object |
The additional info. |
type |
string |
The additional info type. |
MalwareScanningProperties
Properties of Malware Scanning.
Name | Type | Description |
---|---|---|
onUpload |
Properties of On Upload malware scanning. |
|
operationStatus |
Upon failure or partial success. Additional data describing Malware Scanning enable/disable operation. |
|
scanResultsEventGridTopicResourceId |
string |
Optional. Resource id of an Event Grid Topic to send scan results to. |
OnUploadProperties
Properties of On Upload malware scanning.
Name | Type | Description |
---|---|---|
capGBPerMonth |
integer |
Defines the max GB to be scanned per Month. Set to -1 if no capping is needed. |
isEnabled |
boolean |
Indicates whether On Upload malware scanning should be enabled. |
OperationStatus
A status describing the success/failure of the enablement/disablement operation.
Name | Type | Description |
---|---|---|
code |
string |
The operation status code. |
message |
string |
Additional information regarding the success/failure of the operation. |
SensitiveDataDiscoveryProperties
Properties of Sensitive Data Discovery.
Name | Type | Description |
---|---|---|
isEnabled |
boolean |
Indicates whether Sensitive Data Discovery should be enabled. |
operationStatus |
Upon failure or partial success. Additional data describing Sensitive Data Discovery enable/disable operation. |
settingName
Defender for Storage setting name.
Name | Type | Description |
---|---|---|
current |
string |
Name of the Defender for Storage Settings name. |