azure.applicationinsights query is missing api-version
See original GitHub issue- Package Name: azure-applicationinsights
- Package Version: 0.1.0
- Operating System: Ubuntu
- Python Version: 3.8.2
Describe the bug
Using ApplicationInsightsDataClient.query.execute
fails due to not providing api-version query param
To Reproduce Steps to reproduce the behavior:
Set APP_ID to your application insights app ID. (note, this is not the instrumentation ID. You can find it via the “API Access” pane in the App Insights instance in the Azure Portal
from os import environ
from azure.common.client_factory import get_client_from_cli_profile
from azure.applicationinsights import ApplicationInsightsDataClient
from azure.applicationinsights.models import QueryBody
client = get_client_from_cli_profile(ApplicationInsightsDataClient)
query = "traces | where * has '91f42869-0ea5-466c-8684-8f4b6bc31bf4' | order by timestamp desc"
client.query.execute(environ['APP_ID'], body=QueryBody(query=query, timespan="PT3H"))
Expected behavior Exception isn’t generated
Screenshots
$ python /tmp/test.py
Traceback (most recent call last):
File "/tmp/test.py", line 8, in <module>
client.query.execute(environ['APP_ID'], body=QueryBody(query=query, timespan="PT3H"))
File "/home/USER/PROJECT/.direnv/python-3.8.2/lib/python3.8/site-packages/azure/applicationinsights/operations/query_operations.py", line 87, in execute
raise models.ErrorResponseException(self._deserialize, response)
azure.applicationinsights.models.error_response_py3.ErrorResponseException: (MissingApiVersionParameter) The api-version query parameter (?api-version=) is required for all requests.
$
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
MissingApiVersionParameter when querying Azure ...
MissingApiVersionParameter when querying Azure Application Insights API with Python SDK and CLI client credentials.
Read more >Troubleshoot missing application telemetry in Azure Monitor ...
The Application Insights SDK or agent is misconfigured and doesn't send application telemetry to the ingestion endpoint. The SDK or agent is ...
Read more >Application Insights IP address collection - Azure Monitor
Understand how Application Insights handles IP addresses and geolocation.
Read more >Workspace-based Application Insights resources
Sign in to the Azure portal, and create an Application Insights resource. Screenshot that shows a workspace-based Application Insights resource.
Read more >Monitor Azure App Service performance in .NET Core
Confirm that Application Insights Extension Status is Pre-Installed Site Extension, version 2.8. · Confirm that the status source exists and looks like Status ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
fix will be in azure-common 1.1.26 I will release tomorrow
@lmazuel confirmed the new changes work for me.