AZ-400 Question 282
Select 2You are tasked with enabling detailed monitoring for your organization's Azure DevOps build pipelines using Azure Monitor and Log Analytics. The solution must store pipeline logs in a Log Analytics workspace for historical analysis and must allow you to create alerts when the number of failed builds exceeds a threshold within a specified time window. Which two actions must you perform to achieve this integration?
- A
- Configure a Log Analytics workspace and use the Azure Log Analytics Data Collector task in your Azure DevOps pipeline to forward logs.
- B
- Enable continuous export from the Azure DevOps Organization Settings directly to the Log Analytics workspace.
- C
- In Azure Monitor, create an alert rule that queries the Log Analytics workspace for build failure logs.
- D
- Configure a service hook in Azure DevOps to push build logs to an Azure Function for manual processing.
- E
- Install the 'Azure DevOps Pipelines to Blob Storage' extension and reference the storage account in Azure Monitor.
Show answer and explanation
Correct answers: A, C
Explanation
To integrate Azure DevOps pipelines with Azure Monitor via Log Analytics, you must first send logs to a Log Analytics workspace. The easiest approach is employing the Azure Log Analytics Data Collector task in your pipeline to forward build logs (Option 1). Once logs are stored, you can create alert rules in Azure Monitor that rely on Log Analytics queries to trigger notifications based on pipeline failures (Option 3). For more information, refer to Microsoft� documentation on using the Azure Log Analytics Data Collector and creating alert rules in Azure Monitor.
- A. Correct.
Option 1 is correct. Creating or configuring a Log Analytics workspace and using the Azure Log Analytics Data Collector task in your pipeline is a standard way to push pipeline logs to Log Analytics. Once logs are in Log Analytics, you can run queries or set up alerts in Azure Monitor.
- B. Incorrect.
Option 2 is incorrect. Azure DevOps does not offer a direct continuous export feature from Organization Settings to a Log Analytics workspace. Continuous export is a capability found in Application Insights, not Azure DevOps.
- C. Correct.
Option 3 is correct. After your pipeline logs reside in Log Analytics, you can go to Azure Monitor and create an alert rule that queries the workspace for specific conditions, such as multiple failed builds over a given timeframe.
- D. Incorrect.
Option 4 is incorrect. While a service hook can push build information to an Azure Function, this process does not automatically integrate with Log Analytics or Azure Monitor alerts. Additional custom steps would be required to store and analyze logs.
- E. Incorrect.
Option 5 is incorrect. The 'Azure DevOps Pipelines to Blob Storage' extension allows you to archive pipeline logs to Blob Storage but does not directly integrate with Log Analytics and Azure Monitor for alerting.