AI-102 Question 60
Select 3You are responsible for monitoring an Azure Cognitive Services resource that processes sensitive customer data. To ensure compliance and troubleshoot issues effectively, you need to configure diagnostic logging for the resource. Which steps should you take to enable and configure diagnostic logs properly?
- A
Navigate to the Azure Cognitive Services resource in the Azure portal and enable 'Diagnostic settings' to send logs to a Log Analytics workspace.
- B
Use Azure PowerShell to enable diagnostic logging by executing the 'Set-AzDiagnosticSetting' cmdlet.
- C
Configure diagnostic logging directly in the Azure Cognitive Services SDK by enabling logging in the client application code.
- D
Specify the log categories and retention policies when configuring diagnostic logging in the Azure portal.
- E
Enable diagnostic logging by creating a custom policy in Azure Policy to enforce logging settings across your subscription.
Show answer and explanation
Correct answers: A, B, D
Explanation
To configure diagnostic logging for an Azure Cognitive Services resource, you should enable 'Diagnostic settings' either via the Azure portal or programmatically using tools like Azure PowerShell. Additionally, specifying log categories and retention policies is an essential step in the configuration process. Diagnostic settings cannot be enabled directly through the SDK or by creating an Azure Policy, though Azure Policy can help enforce logging compliance across your resources.
- A. Correct.
Correct. The Azure portal allows you to configure diagnostic settings for your resource and send logs to destinations like Log Analytics, Event Hubs, or a storage account.
- B. Correct.
Correct. Azure PowerShell provides the 'Set-AzDiagnosticSetting' cmdlet to programmatically enable diagnostic settings for Azure resources.
- C. Incorrect.
Incorrect. The Azure Cognitive Services SDK does not provide direct support for configuring Azure diagnostic logging. Logging must be enabled at the resource level in Azure.
- D. Correct.
Correct. When configuring diagnostic logging, you can specify the categories of logs (e.g., request logs, operational logs) and retention policies for how long logs are stored.
- E. Incorrect.
Incorrect. Azure Policy can enforce compliance but is not directly used for configuring diagnostic logging. It can ensure that diagnostic settings are applied across resources, but it doesn't enable logging itself.