-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support to disable Diagnostics settings (classic) of Storage Account in Bicep #2321
Comments
Looks like this settings in on data layer => not modifiable with ARM/Bicep directly. E.g. Disable blob metrics is PUT request on with payload of <?xml version="1.0"?>
<StorageServiceProperties>
<Logging>
<Version>1.0</Version>
<Read>false</Read>
<Write>false</Write>
<Delete>false</Delete>
<RetentionPolicy>
<Enabled>false</Enabled>
</RetentionPolicy>
</Logging>
<HourMetrics>
<Version>1.0</Version>
<Enabled>false</Enabled>
<RetentionPolicy>
<Enabled>false</Enabled>
</RetentionPolicy>
</HourMetrics>
<MinuteMetrics>
<Version>1.0</Version>
<Enabled>false</Enabled>
<RetentionPolicy>
<Enabled>false</Enabled>
</RetentionPolicy>
</MinuteMetrics>
</StorageServiceProperties> Even classic metric persist in on by default, it does save metrics because Default state XML: <?xml version="1.0" encoding="utf-8"?>
<StorageServiceProperties>
<Logging>
<Version>1.0</Version>
<Read>false</Read>
<Write>false</Write>
<Delete>false</Delete>
<RetentionPolicy>
<Enabled>false</Enabled>
</RetentionPolicy>
</Logging>
<HourMetrics>
<Version>1.0</Version>
<Enabled>true</Enabled>
<IncludeAPIs>true</IncludeAPIs>
<RetentionPolicy>
<Enabled>true</Enabled>
<Days>7</Days>
</RetentionPolicy>
</HourMetrics>
<MinuteMetrics>
<Version>1.0</Version>
<Enabled>false</Enabled>
<RetentionPolicy>
<Enabled>false</Enabled>
</RetentionPolicy>
</MinuteMetrics>
<Cors/>
<DeleteRetentionPolicy>
<Enabled>true</Enabled>
<Days>30</Days>
<AllowPermanentDelete>false</AllowPermanentDelete>
</DeleteRetentionPolicy>
<StaticWebsite>
<Enabled>false</Enabled>
</StaticWebsite>
</StorageServiceProperties> Bicep/ARM folks are probably going to ask if you have opened support request because this is fixable on by the product group / on resource provider. |
Long time ago, after the Storage Account had been newly created, the Storage logging data ($log blob container) were recorded accordingly. Now only Hour metrics are enabled by default for those 4 storage services. I have to run the following PowerShell script to turn off those Storage Analytics metrics after the Storage Accounts have been created with Bicep templates,
TBH, I don't understand what the retirement of classic metrics (Storage Analytics metrics) means 😉, because as of now I can see it is still enabled by default. |
Issue
Diagnostics are enabled by default on new storage accounts created from the Azure portal, PowerShell and Azure Bicep. In the diagnostic settings (classic) blade, hour metrics are always enabled by default for blob, file, table & queue services, on the new-created Storage Account.
Expected solution
It would be better if we can turn diagnostics on or off by using Azure Bicep.
The text was updated successfully, but these errors were encountered: