azureazure-storagepulumiazure-defender

How to enable azure defender on storage accounts using Pulumi?


I am trying my hand at IaC using Pulumi. I am able to create storage accounts but not enable Azure defender to them. How do I add Azure Defender to identify security threats on my storage accounts?


Solution

  • You should use the security.AdvancedThreatProtection resource, for example:

    const advancedThreatProtection = new azure_native.security.AdvancedThreatProtection("advancedThreatProtection", {
        isEnabled: true,
        resourceId: storageAccount.id,
        settingName: "current",
    });
    

    Also, see a full runnable example.