New_to_work
New_to_work

Reputation: 263

How can I access the data that is getting logged in Azure Application Insights using python sdk?

I have a template deployed on azure which creates a resource group with various resources. These resources include an Application Insight. I want to access the latest data generated in 'event1' and 'event2' in my Application Insight using python 2.7.5. How to do that?

I have tried using azurerm but couldn't get the data.

Upvotes: 1

Views: 1377

Answers (1)

Ivan Glasenberg
Ivan Glasenberg

Reputation: 29940

If you want to get the data in application insights, you should use App Insights rest api.

First, you should follow this doc on how to get API key and Application ID.

Second, you can nav to this link, write your query to get the data you want. It will generate a get query url which you should use it for the query.

Thrid, you should use python to build a get request. And in this doc, there is an exmaple written in c#, you can try to modify it with python.

If everything is ok, you should get the data.

And if you cannot figure it out, I can provide you a python example later when I'm availabe.

Upvotes: 3

Related Questions