faizan
faizan

Reputation: 304

KQL queries to retrieve Azure cost

Is there any way to retrieve cost using Kusto Query Language on Azure through Graph explorer? All of my Azure's resources are tagged with the creator's email address and I am trying to figure it out if there is any way to write KQL queries to retrieve costs based on the creator's email address?

Note: I have already explored the default Azure cost management but it does not provide such a flexibility.

Upvotes: 2

Views: 1179

Answers (1)

Francesco Mantovani
Francesco Mantovani

Reputation: 12237

No, there is no way to retrieve cost using KQL.

This because Azure Graph explorer is completely disconnected from all cost information.

There is an OpenSource project called azure-orphan-resources which is developed by a Microsoft developer.

Under the hood there are only KQL queries. Creating a bridge between KQL and cost is on its pipeline but we are still far away from that. Basically if you need to query cost you always have to pass through a REST API call to the Azure API.

ALTERNATIVE:

What I'm doing right now is to

  • Export the Cost Analysis and import it into Power BI
  • Query Graph Explore from Power BI

And basically merge the two in Power BI.

Not easy.

Upvotes: 1

Related Questions