简体   繁体   English

如何将 Azure 成本和使用数据发送到日志分析工作区或直接发送到 azure 指标?

[英]How to send Azure costs and usage data to log analytics workspace or directly to azure metrics?

I need to build a dashboard which will visuallize the usage and cost of many azure subscriptions.我需要构建一个仪表板,以可视化许多 azure 订阅的使用情况和成本。 accounts, departments.账户,部门。 My plan was:我的计划是:

  1. Send the data that is 'behind' the Azure Cost Analysis view, to the log analytics workspace.将 Azure 成本分析视图“背后”的数据发送到日志分析工作区。
  2. In the log analytics workspace, perform custom aggregations / filters.在日志分析工作区中,执行自定义聚合/过滤器。
  3. Display those aggregations as charts in Azure Metrics or directly in Azure Dashboard.在 Azure 指标中或直接在 Azure 仪表板中将这些聚合显示为图表。

Problem is with step 1, I dont know how to send the data that is 'behind' the Azure Cost Analysis view, to the log analytics workspace.问题出在第 1 步,我不知道如何将 Azure 成本分析视图“背后”的数据发送到日志分析工作区。 I thought of two solutions:我想到了两个解决方案:

  1. Fetching the data from azure cost & billing API.从 azure 成本和账单 API 获取数据。
  2. Schedule Export cost analysis data to a storage account, and then somehow moving the data from the storage account to the log analytics workspace.计划将成本分析数据导出到存储帐户,然后以某种方式将数据从存储帐户移动到日志分析工作区。

Both solutions seems to me a bit 'overkilling' - is there a more direct approach to send the cost analysis data to log analytics workspace?这两种解决方案在我看来都有点“矫枉过正”——是否有更直接的方法将成本分析数据发送到日志分析工作区? If there is no option such as that, I would be happy to know how would you suggest moving the exported data from the storage account to the log analytics, or do you have some other idea?如果没有这样的选择,我很高兴知道您建议如何将导出的数据从存储帐户移动到日志分析,或者您有其他想法吗?

Thank you!谢谢!

I believe a direct approach is currently not available but I see this feature request raised in UserVoice / feedback forum for the same requirement.我相信目前还没有直接的方法,但我看到在 UserVoice / 反馈论坛中针对相同的要求提出了功能请求。 If interested, you may upvote it because in general the responsible Azure product / feature team would triage / start checking feasibility and prioritizing a received feedback based on various factors like number of votes a feedback receives, feasibility, open prioritized backlog items, etc.如果有兴趣,您可以投票,因为通常负责的 Azure 产品/功能团队将根据各种因素(例如反馈收到的票数、可行性、打开优先级积压项目等)对收到的反馈进行分类/开始检查可行性并确定收到的反馈的优先级。

I would suggest you to fetch the data from azure cost & billing API and send that data to Log Analytics from a REST API client by using the HTTP Data Collector API. I would suggest you to fetch the data from azure cost & billing API and send that data to Log Analytics from a REST API client by using the HTTP Data Collector API. For more information and illustration with examples, refer this Azure document.有关更多信息和示例说明,请参阅Azure 文档。 Or else if you want to fetch the data from azure cost & billing API and store it in a machine then you may go with custom logs.或者,如果您想从 azure 成本和计费 API 中获取数据并将其存储在机器中,那么您可以使用自定义日志 go 获取数据。 For more information w.r.t it, refer this Azure document.有关 w.r.t 的更多信息,请参阅Azure 文档。

Other related references:其他相关参考:

Hope this helps!希望这可以帮助! Cheers!干杯!

The only native solution is, to schedule from the Costs-Blade an export of the Costs as CSV into a StorageAccount.唯一的本机解决方案是,从成本刀片安排将成本作为 CSV 导出到 StorageAccount。 If you want to load the Data into a Log-Analytics-Workspace, Azure Automation and a scheduled Script would work.如果您想将数据加载到日志分析工作区,Azure 自动化和预定脚本将起作用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure Kubernetes 服务到 Log Analytics 工作区 - 重复指标 ContainerInsights 和 LogManagement - Azure Kubernetes Service to Log Analytics Workspace - duplicated metrics ContainerInsights and LogManagement 如何轮换 Azure 日志分析工作区的密钥 - How to rotate keys for azure log analytics workspace 如何将天蓝色cosmos db的度量标准/诊断日志发送到天蓝色日志分析? - how to send metrics/ diagnostics logs of azure cosmos db to azure log analytics? 如何将 Azure 存储帐户活动日志发送到 Azure 日志分析工作区 - How to send Azure storaeg account activity logs to Azure Log analytics workspace 如何将数据从 .net 核心 api 发送到 azure 日志分析 - How to send data from .net core api to azure log analytics 如何连接 Azure 中现有的自动化帐户和 Log Analytics 工作区? - How to connect existing Automation Account and Log Analytics workspace in Azure? 如何在 Azure Log Analytics 工作区中获取 Windows 安全事件? - How to get Windows Security Events in Azure Log Analytics Workspace? 如何通过 powershell 将 PostgreSQL 数据库连接到 azure 中的日志分析工作区? - How to connect PostgreSQL database to log analytics workspace in azure via powershell? 如何在 azure 门户中永久删除旧的 Log-analytics-workspace? - How to delete old Log-analytics-workspace permanently in azure portal? 如何使用 az CLI 获取 Azure Log Analytics 的工作区 ID? - How to get workspace ID of Azure Log Analytics using az CLI?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM