diff --git a/sdk/monitor/azure-monitor-query/CHANGELOG.md b/sdk/monitor/azure-monitor-query/CHANGELOG.md index f250c47dd4e2..e34f264b3406 100644 --- a/sdk/monitor/azure-monitor-query/CHANGELOG.md +++ b/sdk/monitor/azure-monitor-query/CHANGELOG.md @@ -9,7 +9,6 @@ - Added `LogsQueryStatus` Enum to describe the status of a result. - Added a new `LogsTableRow` type that represents a single row in a table. - Items in `metrics` list in `MetricsQueryResult` can now be accessed by metric names. -- Added `audience` keyword to support providing credential scope when creating clients. ### Breaking Changes diff --git a/sdk/monitor/azure-monitor-query/azure/monitor/query/_logs_query_client.py b/sdk/monitor/azure-monitor-query/azure/monitor/query/_logs_query_client.py index 24db36531e8b..9f95c97860d1 100644 --- a/sdk/monitor/azure-monitor-query/azure/monitor/query/_logs_query_client.py +++ b/sdk/monitor/azure-monitor-query/azure/monitor/query/_logs_query_client.py @@ -49,21 +49,18 @@ class LogsQueryClient(object): :type credential: ~azure.core.credentials.TokenCredential :keyword endpoint: The endpoint to connect to. Defaults to 'https://api.loganalytics.io'. :paramtype endpoint: str - :keyword audience: URL to use for credential authentication with AAD. - :paramtype audience: str """ def __init__(self, credential, **kwargs): # type: (TokenCredential, Any) -> None - audience = kwargs.pop("audience", None) - endpoint = kwargs.pop("endpoint", "https://api.loganalytics.io/v1") + endpoint = kwargs.pop("endpoint", "https://api.loganalytics.io") if not endpoint.startswith("https://") and not endpoint.startswith("http://"): endpoint = "https://" + endpoint self._endpoint = endpoint self._client = MonitorQueryClient( credential=credential, - authentication_policy=get_authentication_policy(credential, audience), - base_url=self._endpoint, + authentication_policy=get_authentication_policy(credential, endpoint), + base_url=self._endpoint.rstrip('/') + "/v1", **kwargs ) self._query_op = self._client.query diff --git a/sdk/monitor/azure-monitor-query/azure/monitor/query/_metrics_query_client.py b/sdk/monitor/azure-monitor-query/azure/monitor/query/_metrics_query_client.py index 31e762761c85..5c1dc2b739fe 100644 --- a/sdk/monitor/azure-monitor-query/azure/monitor/query/_metrics_query_client.py +++ b/sdk/monitor/azure-monitor-query/azure/monitor/query/_metrics_query_client.py @@ -44,8 +44,6 @@ class MetricsQueryClient(object): :type credential: ~azure.core.credentials.TokenCredential :keyword endpoint: The endpoint to connect to. Defaults to 'https://management.azure.com'. :paramtype endpoint: str - :keyword audience: URL to use for credential authentication with AAD. - :paramtype audience: str """ def __init__(self, credential, **kwargs): diff --git a/sdk/monitor/azure-monitor-query/azure/monitor/query/_models.py b/sdk/monitor/azure-monitor-query/azure/monitor/query/_models.py index f42064048c66..1b7b30da04de 100644 --- a/sdk/monitor/azure-monitor-query/azure/monitor/query/_models.py +++ b/sdk/monitor/azure-monitor-query/azure/monitor/query/_models.py @@ -235,10 +235,10 @@ class LogsQueryResult(object): :vartype tables: list[~azure.monitor.query.LogsTable] :ivar statistics: This will include a statistics property in the response that describes various performance statistics such as query execution time and resource usage. - :vartype statistics: object + :vartype statistics: Mapping :ivar visualization: This will include a visualization property in the response that specifies the type of visualization selected by the query and any properties for that visualization. - :vartype visualization: object + :vartype visualization: Mapping :ivar status: The status of the result. Always 'Success' for an instance of a LogsQueryResult. :vartype status: ~azure.monitor.query.LogsQueryStatus @@ -585,10 +585,10 @@ class LogsQueryPartialResult(object): :vartype partial_data: list[~azure.monitor.query.LogsTable] :ivar statistics: This will include a statistics property in the response that describes various performance statistics such as query execution time and resource usage. - :vartype statistics: object + :vartype statistics: Mapping :ivar visualization: This will include a visualization property in the response that specifies the type of visualization selected by the query and any properties for that visualization. - :vartype visualization: object + :vartype visualization: Mapping :ivar partial_error: The partial errror info :vartype partial_error: ~azure.monitor.query.LogsQueryError :ivar status: The status of the result. Always 'PartialError' for an instance of a LogsQueryPartialResult. diff --git a/sdk/monitor/azure-monitor-query/azure/monitor/query/aio/_logs_query_client_async.py b/sdk/monitor/azure-monitor-query/azure/monitor/query/aio/_logs_query_client_async.py index 4e4df78df924..7c49bbac5df2 100644 --- a/sdk/monitor/azure-monitor-query/azure/monitor/query/aio/_logs_query_client_async.py +++ b/sdk/monitor/azure-monitor-query/azure/monitor/query/aio/_logs_query_client_async.py @@ -35,20 +35,17 @@ class LogsQueryClient(object): :type credential: ~azure.core.credentials_async.AsyncTokenCredential :keyword endpoint: The endpoint to connect to. Defaults to 'https://api.loganalytics.io/v1'. :paramtype endpoint: str - :keyword audience: URL to use for credential authentication with AAD. - :paramtype audience: str """ def __init__(self, credential: "AsyncTokenCredential", **kwargs: Any) -> None: - audience = kwargs.pop("audience", None) - endpoint = kwargs.pop("endpoint", "https://api.loganalytics.io/v1") + endpoint = kwargs.pop("endpoint", "https://api.loganalytics.io") if not endpoint.startswith("https://") and not endpoint.startswith("http://"): endpoint = "https://" + endpoint self._endpoint = endpoint self._client = MonitorQueryClient( credential=credential, - authentication_policy=get_authentication_policy(credential, audience), - base_url=self._endpoint, + authentication_policy=get_authentication_policy(credential, endpoint), + base_url=self._endpoint.rstrip('/') + "/v1", **kwargs ) self._query_op = self._client.query diff --git a/sdk/monitor/azure-monitor-query/azure/monitor/query/aio/_metrics_query_client_async.py b/sdk/monitor/azure-monitor-query/azure/monitor/query/aio/_metrics_query_client_async.py index 6751b11b6c39..cadec7a5770a 100644 --- a/sdk/monitor/azure-monitor-query/azure/monitor/query/aio/_metrics_query_client_async.py +++ b/sdk/monitor/azure-monitor-query/azure/monitor/query/aio/_metrics_query_client_async.py @@ -32,8 +32,6 @@ class MetricsQueryClient(object): :type credential: ~azure.core.credentials.TokenCredential :keyword endpoint: The endpoint to connect to. Defaults to 'https://management.azure.com'. :paramtype endpoint: str - :keyword audience: URL to use for credential authentication with AAD. - :paramtype audience: str """ def __init__(self, credential: "AsyncTokenCredential", **kwargs: Any) -> None: