Skip to main content
Azure Log Analytics

Use Azure Log Analytics steps in your Torq automated workflows.

Updated yesterday

Azure Log Analytics, part of Microsoft’s Azure Monitor, collects and analyzes telemetry data from Azure, on-premises, and third-party sources, with integration to Sentinel for enhanced security. With Kusto Query Language (KQL), it helps monitor performance, enhance security, and troubleshoot issues.

Torq enables quick and easy integration with Azure Log Analytics, so you can automate anything and everything within moments. Torq's public Azure Log Analytics steps include:

  • Generate Access Token

  • Execute Query

If you don't see a step you need, you can create your own in various ways, such as using the Send an HTTP Request step or Torq’s Step Builder, and share it across your organization.

To use Azure Log Analytics steps in Torq workflows, look here.

Use Azure Analytics Steps in a Torq Workflow

Step One: Create an Application Registration in Azure for Azure Log Analytics

  1. In Azure: Go to your Azure administration portal and navigate to Microsoft Entra ID > App Registrations > New Registration.

  2. Fill in Details: Choose a unique and meaningful name for your app and click Register.

  3. API Permissions: Select API Permissions > Add permission > APIs my organization uses > type Log Analytics API and select Log Analytics API.

    1. This enables you to access Azure Log Analytics' API

  4. Application Permissions: Select Application Permissions. Choose the Data.Read permission and then click Add Permissions.

  5. Admin Consent: Select Grant admin consent.

  6. Get Secret: Go to Certificates and Secrets and give the secret a meaningful description such as Torq Secret, and click Add.

    1. Save the secret in a safe location for later use in Torq.

  7. Save Details: Go to Overview and copy the Display nameApplication ID, and Tenant ID, and save them somewhere safe for use later in Torq.

  8. Assign Role: Go to your Azure portal and type Log Analytics Workspaces in the search bar. Select Log Analytics Workspaces.

    1. Select the appropriate Log Analytics Workspace from the list, and copy the Workspace ID somewhere safe for use later in Torq.

    2. Select Access Control (IAM) from the left navigation pane.

    3. Select the Role Assignments tab and then select +Add > Add role assignment

    4. Select the Job function roles tab, and type Log Analytics Reader in the search bar.

    5. Select the Log Analytics Reader role and click Next:

    6. Select Assign access to > User, group or service principal

    7. Click +Select Members

    8. In the Select Members search bar, type the display name of the application registration that you copied earlier in step 7. Locate your application and click Select.

  9. Finalize: Click Next > Review and Assign. Move to the Torq platform for Step Two.

Step Two: Create an Azure Log Analytics Steps Integration in Torq

  1. Add Integration: Go to Build > Integrations > Steps > Azure Log Analytics and click Add.

  2. Fill in Details:

    1. Give the integration a unique and meaningful name.

    2. In Azure Tenant ID, enter the Tenant ID you copied earlier in step 7.

    3. In Azure Application Client ID, enter the Application ID you copied earlier in step 7.

    4. In Client Secret, enter the secret you created earlier in step 6.

  3. Finalize: Click Save to save.

Step Three: Execute Azure Log Analytics Queries in Torq Workflows

  1. Go to Workflows: Go to Build > Workflows. Create a new workflow or access a workflow from which you want to execute a query to Azure Log Analytics.

  2. Store Azure Log Workspace ID: Add a new Workflow Parameters step to your workflow (if you don't already have one) to store the Azure Log Analytics Workspace ID you copied earlier in step 8.a.

  3. Generate Access Token: Add a new Azure Log Analytics Generate Access Token step to the designer. Select the Azure Log Analytics integration you created earlier.

  4. Optionally: Add a new Azure Log Analytics Execute Query step and set it up to use:

    1. The access token generated by the Azure Log Analytics Generate Access Token step

    2. The Workspace ID stored in the Workflow Parameters step

    3. The KQL query that you want to perform. For example, here the query given is union * | where TimeGenerated > ago(1h) | summarize count() by Type, TenantId


Templates

Now that you've added your integration check out these specially crafted templates by Torq's security experts. Visit Torq's template library for more.

Did this answer your question?