0
0
Azurecloud~10 mins

Diagnostic settings for resources in Azure - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the resource ID for diagnostic settings.

Azure
{
  "resourceId": "[1]"
}
Drag options to blanks, or click blank then click option'
A/subscriptions/12345/resourceGroups/myRG/providers/Microsoft.Storage/storageAccounts/myStorage
B/subscriptions/12345/resourceGroups/myRG/providers/Microsoft.Network/virtualNetworks/myVNet
C/subscriptions/12345/resourceGroups/myRG/providers/Microsoft.Compute/virtualMachines/myVM
D/subscriptions/12345/resourceGroups/myRG/providers/Microsoft.Web/sites/myWebApp
Attempts:
3 left
💡 Hint
Common Mistakes
Using a resource ID for a different resource type than intended.
2fill in blank
medium

Complete the code to enable logs in the diagnostic settings.

Azure
{
  "logs": [
    {
      "category": "StorageRead",
      "enabled": [1]
    }
  ]
}
Drag options to blanks, or click blank then click option'
A"false"
Bfalse
C"true"
Dtrue
Attempts:
3 left
💡 Hint
Common Mistakes
Using strings "true" or "false" instead of boolean true or false.
3fill in blank
hard

Fix the error in the diagnostic settings to correctly specify the retention policy.

Azure
{
  "retentionPolicy": {
    "enabled": [1],
    "days": 30
  }
}
Drag options to blanks, or click blank then click option'
A"true"
Btrue
C"false"
Dfalse
Attempts:
3 left
💡 Hint
Common Mistakes
Using string values for boolean properties.
4fill in blank
hard

Fill both blanks to configure metrics with retention policy enabled for 7 days.

Azure
{
  "metrics": [
    {
      "category": "AllMetrics",
      "enabled": [1],
      "retentionPolicy": {
        "enabled": [2],
        "days": 7
      }
    }
  ]
}
Drag options to blanks, or click blank then click option'
Atrue
Bfalse
C"true"
D"false"
Attempts:
3 left
💡 Hint
Common Mistakes
Using string values instead of booleans.
Confusing enabled flags for metrics and retention policy.
5fill in blank
hard

Fill all three blanks to configure diagnostic settings with logs enabled, metrics disabled, and retention policy enabled for 15 days.

Azure
{
  "logs": [
    {
      "category": "Write",
      "enabled": [1]
    }
  ],
  "metrics": [
    {
      "category": "Transaction",
      "enabled": [2],
      "retentionPolicy": {
        "enabled": [3],
        "days": 15
      }
    }
  ]
}
Drag options to blanks, or click blank then click option'
Atrue
Bfalse
C"true"
D"false"
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up true and false for enabled flags.
Using strings instead of booleans.