Skip to content

Commit 1dc076f

Browse files
Merge pull request #235010 from yuval-reshef/patch-1
Fix ARM & Bicep Templates for Defender for Storage
2 parents 0cc1d27 + 0e3d609 commit 1dc076f

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

articles/storage/common/azure-defender-storage-configure.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,9 @@ To enable and configure Microsoft Defender for Storage at the storage account le
283283

284284
```json
285285
{
286-
"type": "Microsoft.Storage/storageAccounts/providers/DefenderForStorageSettings",
286+
"type": "Microsoft.Security/DefenderForStorageSettings",
287287
"apiVersion": "2022-12-01-preview",
288-
"name": "[concat(parameters('accountName'), '/Microsoft.Security/current')]",
288+
"name": "current",
289289
"properties": {
290290
"isEnabled": true,
291291
"malwareScanning": {
@@ -298,7 +298,8 @@ To enable and configure Microsoft Defender for Storage at the storage account le
298298
"isEnabled": true
299299
},
300300
"overrideSubscriptionLevelSettings": true
301-
}
301+
},
302+
"scope": "[resourceId('Microsoft.Storage/storageAccounts', parameters('StorageAccountName'))]"
302303
}
303304
```
304305

@@ -315,10 +316,11 @@ Learn more about the [ARM template AzAPI reference](/azure/templates/microsoft.s
315316
To enable and configure Microsoft Defender for Storage at the storage account level using [Bicep](../../azure-resource-manager/bicep/overview.md), add the following to your Bicep template:
316317

317318
```bicep
318-
param accountName string
319+
resource storageAccount 'Microsoft.Storage/storageAccounts@2021-04-01' ...
319320
320-
resource accountName_current 'Microsoft.Storage/storageAccounts/providers/DefenderForStorageSettings@2022-12-01-preview' = {
321-
  name: '${accountName}/Microsoft.Security/current'
321+
resource defenderForStorageSettings 'Microsoft.Security/DefenderForStorageSettings@2022-12-01-preview' = {
322+
name: 'current'
323+
scope: storageAccount
322324
  properties: {
323325
    isEnabled: true
324326
    malwareScanning: {

0 commit comments

Comments
 (0)