Access the Azure portal and search for "Data Collection Rules (DCR)”.
Select the same resource group and region as of your cluster.
In Platform type, select the type of instance you have like Windows, Linux or both.
You can leave data collection endpoint as blank.
In the resources section, add the Virtual machine Scale Set (VMSS) resource which is attached to the Service fabric cluster.
In the "Collect and deliver" section, click on Add data source and add both Performance Counters and Windows Event Logs one by one.
Choose the destination for both the data sources as Azure Monitor Logs and in the Account or namespace dropdown, select the name of the Log Analytics workspace that we have created in step 1 and click on Add data source.
Once the DCR is created, in the left panel, click on Resources.
Check if you can see the VMSS resource that we have added while creating DCR or not.
If not then, click on "Add" and navigate to the VMSS attached to service fabric cluster and click on Apply.
Refresh the resources tab to see whether you can see VMSS in the resources section or not. If not, try adding a couple of times if needed.
Querying Logs and Verifying AzureMonitoringAgent Setup:
Please allow for 10-15 minutes waiting period before proceeding. After this time has elapsed, navigate to your Log Analytics workspace, and access the 'Logs' section by scrolling through the left panel.
Run your queries to see the logs. For example, query to check the heartbeat of all instances:Heartbeat | where Category contains "Azure Monitor Agent" | where OSType contains "Windows"
You will see the logs there in the bottom panel as shown in the above screenshot. Also, you can modify the query as per your requirement.
Perform the uninstallation of the MicrosoftMonitoringAgent (MMA): Once you have verified that the logs are getting generated, you can go to Virtual Machine Scale Set and then to the "Extensions + applications" section and delete the old MMA extension from VMSS.