Azure Monitor resource logs

Completed

Resource logs provide insight into operations that an Azure resource (such as Azure Machine Learning) completed. Logs are generated automatically, but you must route them to Log Analytics or a different service to save or query them.

To route Azure Machine Learning logs to Log Analytics, perform the following steps:

  1. In the Azure portal, open the Azure Machine Learning resource.

  2. On the left menu, expand Monitoring and select Diagnostic settings.

  3. Select Add diagnostic setting.

  4. On the Diagnostic setting pane, provide a name for the diagnostic setting.

  5. Under Logs, select the log categories that you want to export. You can also select metrics to be exported.

  6. Under Destination details, select Send to Log Analytics workspace.

  7. Select the subscription and Log Analytics workspace that you want to export this data to.

    Screenshot of the diagnostic settings in the Azure portal.

  8. Select Save to save and close the export configuration.

  9. Back on the Diagnostic settings page, you should now be able to see the configuration. If necessary, you can change the settings for this export by selecting Edit setting.

After you configure the diagnostic setting, you can query the logs in Log Analytics:

  1. In the Azure portal, open the Azure Machine Learning resource.

  2. On the left menu, expand Monitoring and select Logs.

  3. If Queries Hub opens, you can close it.

    Queries Hub provides a sample of queries that you can use. The queries have the context of the resource type that you're looking into. It's an easy way to get started with Log Analytics.

  4. On the New Query 1* tab, select the dropdown menu on the right side to change Simple mode to KQL. (KQL stands for Kusto Query Language.)

  5. In the KQL query editor, you can enter the query that you want to perform. The following example checks for records for a specific job name:

    _AmlComputeJobEvent_
    *| where JobName == "musing_date_yg60v862b2"*
    _| project  TimeGenerated , ClusterId , EventType , ExecutionState , ToolType_
    
  6. Select Run to run the query.

Screenshot of the KQL code in a log query in the Azure portal.

After you run the query, you can analyze the results on the Results tab.