This is an older Microsoft Azure client library for interacting with Azure Log Analytics. It is no longer maintained and has been officially deprecated. For querying data, users are advised to migrate to the `azure-monitor-query` library. For ingesting data into Log Analytics, the `azure-monitor-ingestion` library should be used. The last stable release for this package was 0.1.1 in 2021.
pip install azure-loganalyticsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to query Azure Log Analytics using the recommended `azure-monitor-query` client library. It authenticates using `DefaultAzureCredential` (which leverages environment variables or Azure CLI login) and executes a Kusto Query Language (KQL) query against a specified Log Analytics workspace. Replace `<your_log_analytics_workspace_id>` with your actual workspace ID.
Migrate your code to use `azure-monitor-query` for querying logs and `azure-monitor-ingestion` for sending custom logs. Install them via `pip install azure-monitor-query azure-monitor-ingestion azure-identity`.
Refactor your application to use `LogsQueryClient` from `azure.monitor.query` and `LogsIngestionClient` from `azure.monitor.ingestion`. Refer to their respective documentation for migration guidance.
Ensure you are using the correct library for your task: `azure-mgmt-loganalytics` for management tasks, and `azure-monitor-query` for querying logs.
Install `azure-identity` and use `DefaultAzureCredential`. Set environment variables like `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET` or use `az login` via Azure CLI to enable automatic authentication.