Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,658 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
client = LogsQueryClient(credential)
17 try:
---> 18 response = client.query_workspace(
19 'XXXXXXX',
20 query=self.query,
21 timespan=timedelta(days=1)
22 )
23 if response.status == LogsQueryStatus.PARTIAL:
24 error = response.partial_error
File c:\Users\sank000\AppData\Local\Programs\Python\Python311\Lib\site-packages\azure\core\tracing\decorator.py:76, in distributed_trace..decorator..wrapper_use_tracer(*args, **kwargs)
74 span_impl_type = settings.tracing_implementation()
75 if span_impl_type is None:
---> 76 return func(*args, **kwargs)
78 # Merge span is parameter is set, but only if no explicit parent are passed
79 if merge_span and not passed_in_parent:
...
--> 364 raise error
365 if _is_rest(request):
366 from azure.core.rest._requests_basic import RestRequestsTransportResponse
ServiceRequestError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1002)
To resolve this error for LogsQueryClient
in the Azure SDK for Python, you can try the following steps:
certifi
library in Python to manage the trusted root store. import certifi
import ssl
# Create an SSL context with the trusted root store
ssl_context = ssl.create_default_context(cafile=certifi.where())
```
1. Disable SSL certificate verification in the client. This is not recommended as it could expose the client to security risks. However, if you want to proceed with this option, you can use the **`verify=False`** parameter when creating the **`LogsQueryClient`**.
1.
```python
client = LogsQueryClient(credential, verify=False)
```
Let me know if it helps.
Thanks!