How to enable azure defender on storage accounts using Pulumi?

212 views Asked by At

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?

1

There are 1 answers

0
Mikhail Shilkov On BEST ANSWER

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.