Complete the code to specify the resource ID for diagnostic settings.
{
"resourceId": "[1]"
}The resourceId must point to the specific Azure resource you want to monitor. Here, the storage account resource ID is correct for diagnostic settings.
Complete the code to enable logs in the diagnostic settings.
{
"logs": [
{
"category": "StorageRead",
"enabled": [1]
}
]
}The "enabled" property expects a boolean value. Using true enables the logs.
Fix the error in the diagnostic settings to correctly specify the retention policy.
{
"retentionPolicy": {
"enabled": [1],
"days": 30
}
}The retentionPolicy enabled property must be a boolean true or false, not a string.
Fill both blanks to configure metrics with retention policy enabled for 7 days.
{
"metrics": [
{
"category": "AllMetrics",
"enabled": [1],
"retentionPolicy": {
"enabled": [2],
"days": 7
}
}
]
}The "enabled" property for metrics should be true (boolean) to activate metrics collection. The retentionPolicy enabled is true (boolean) to enable retention policy for 7 days.
Fill all three blanks to configure diagnostic settings with logs enabled, metrics disabled, and retention policy enabled for 15 days.
{
"logs": [
{
"category": "Write",
"enabled": [1]
}
],
"metrics": [
{
"category": "Transaction",
"enabled": [2],
"retentionPolicy": {
"enabled": [3],
"days": 15
}
}
]
}Logs are enabled with true, metrics are disabled with false, and retention policy is enabled with true for 15 days.