Step 4: Test data collections in Azure Monitor Agent

In this article, you can find several methods for linking recently formed data collection rules (DCRs) with existing virtual machines (VMs). By following these techniques, you can begin gathering data for analysis in a testing or production environment.

Deploy newly generated DCRs to a test workspace

Deploy Log Analytics testing workspace

To set up a short-term Log Analytics workspace for testing purposes, follow these steps:

  1. Sign in to the Azure portal with your Azure account credentials.
  2. In the search bar at the top of the portal, type Log Analytics and press Enter to open the Log Analytics blade.
  3. Select the + Add or Add button to create a new Log Analytics workspace.
  4. Fill in the required details for your new workspace, such as the name and the subscription where you want to create it.
  5. Select a resource group for your new workspace. You can create a new one or use an existing one.
  6. Select the location for your Log Analytics workspace. This should be the same region as your virtual machines.
  7. Select Create to start the deployment process. The creation of the Log Analytics workspace may take several minutes.
  8. Once the deployment is complete, navigate to the newly created Log Analytics workspace in the Azure portal.

Swap the production workspace with the test workspace

  1. In the search bar at the top of the portal, type Data Collection Rules and press Enter to open the Data Collection Rules blade.
  2. Select the data collection rule that you newly created with the DCR tool.
  3. Select Configuration > Data Sources, and then select a data source.
  4. Validate the data source setting and select the Destination tab.
  5. Select Destination Details to remove the production workspace and replace with testing workspace.
  6. Begin your testing activities within this temporary Log Analytics workspace, ensuring that you have all required permissions and access levels in place.

Associate VMs to the DCR

  1. In the list of DCRs, select the DCR that you want to associate with VMs.

  2. In the menu pane of the DCR, locate the Configuration, and then select Resources.

    Azure portal screenshot of the data collection rule's Resources page.

  3. Select the + Add button to search VMs to associate with the DCR. The Select a scope pane appears:

    Azure portal screenshot of the data collection rule's Select a scope pane after you select the Add button.

  4. Locate the VMs that you want to associate with the DCR, and then select the Apply button. If Azure Monitor Agent isn't deployed to the VM, it's deployed at this time.

You're now ready to validate your configuration.

Post validation steps

Once the data validation is complete, perform these steps:

  1. Switch the destination workspace in the DCR from the temporary workspace to the production workspace.
  2. Remove the legacy agent extension from the VM in the portal.

Migration is now complete. To migrate more workspaces, repeat the steps.

To check the latest status of your migration, see the AMA Migration Helper workbook:

Azure portal screenshot of the Azure Virtual Machines tab of the Azure Monitor Agent Migration Helper workbook.

Troubleshoot Azure Monitor Agent

To troubleshoot Azure Monitor Agent, you can use one of the following tools:

Contact us for help

If you have questions or need help, create a support request, or ask Azure community support. You can also submit product feedback to Azure feedback community.