question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 3 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
lmazuelcommented, Nov 11, 2020

fix will be in azure-common 1.1.26 I will release tomorrow

2reactions
bmc-msftcommented, Nov 10, 2020

@lmazuel confirmed the new changes work for me.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found