AzureMonitorQueryClient
Minimal Azure Monitor Query REST client: one KQL query against one Log Analytics workspace, nothing else.
Authenticates with a bearer AzureTokenProvider scoped to https://api.loganalytics.io/ — build one via AzureTokenProviderFactory, not AzureCredentialFactory, since this API takes no storage-account-key credential at all.
Synopsis
Section titled “Synopsis”final class AzureMonitorQueryClient implements AzureMonitorQueryClientInterface
| Implements | AzureMonitorQueryClientInterface |
| Source | AzureMonitorQueryClient.php |
Constructor
Section titled “Constructor”__construct()
Section titled “__construct()”public function __construct(ClientInterface $httpClient, AzureTokenProvider $tokenProvider, string $workspaceId, string $endpoint = 'https://api.loganalytics.io', Psr17Factory $psr17 = new Psr17Factory(…)): mixed
| Parameter | Type | Description |
|---|---|---|
$httpClient | ClientInterface | |
$tokenProvider | AzureTokenProvider | |
$workspaceId | string | |
$endpoint | string | |
$psr17 | Psr17Factory |
Returns mixed
Methods
Section titled “Methods”| Method | Description |
|---|---|
query(string $kql): list<array<string, mixed>> | Runs $kql and returns its primary result table as one row per array, keyed by column name. |
query()
Section titled “query()”public function query(string $kql): list<array<string, mixed>>
Runs $kql and returns its primary result table as one row per array, keyed by column name.
An empty result set (including a query with no tables at all) is an empty list, not an error.
| Parameter | Type | Description |
|---|---|---|
$kql | string |
Returns list``<``array``<``string``, ``mixed``>``>
| Throws | When |
|---|---|
AzureStorageException | On a non-2xx response, a transport failure that survived the retries, or a response body that was not the JSON shape this expects. |