Microsoft Azure Administrator Associate AZ-104 Practice Question
You need to collect logs and metrics from multiple Azure virtual machines and send them to an Azure Log Analytics workspace. You also require that any new virtual machines added in the future automatically send their logs to the workspace. Which approach should you use to achieve this?
Configure an Azure Policy that deploys the Log Analytics agent to virtual machines.
Add the virtual machines to the same resource group as the Log Analytics workspace.
Install the Log Analytics agent manually on the existing virtual machines.
Enable diagnostic settings on each virtual machine to send logs to the workspace.