问题标签 [azure-billing-api]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
229 浏览

azure - Azure 计费使用 API 聚合功能不起作用

我正在使用 Azure 计费 API (Resource Usage-Preview) 来获取 Azure 订阅的消费数据,并尝试每天获取特定日期的聚合数据。根据文档,我在调用定义数据应该聚合的 API 时将 showDetails 参数发送为 false,但无法获取聚合数据。为了确保问题,我将数据存储在数据库中,并发现相同subscriptionId、meterId、usageStartTime 和usageEndTime 的重复条目,这似乎不正确,而且无论showDetails(真或假)参数的值如何,我得到相同数量的所有未汇总的记录。

我正在使用的网址: https : //management.azure.com/subscriptions/My SubscriptionId/providers/Microsoft.Commerce/UsageAggregates?api-version=2015-06-01-preview&reportedstartTime=2016-03-02+00%3a00 %3a00Z&reportedEndTime=2016-03-03+00%3a00%3a00Z&aggregationGranularity=每日&showDetails=false

请问有没有人遇到过同样的问题或对此有任何想法?

0 投票
1 回答
432 浏览

azure - Azure Billing Usage API 的使用数据中的计量 ID 不正确时该怎么办

我从 Azure Usage Billing API 得到错误的 Meter ID。错误的确切响应条目如下所示。请注意,它是文本“1core”而不是 Guid。因此我无法从费率卡 API 数据中找到它的费率。我还注意到资源类别等许多其他属性也是空的。这个相同的条目在不同的日子里重复。

谁能告诉我为什么会这样?以及在尝试计算每月账单时我应该如何处理这个条目?

0 投票
2 回答
444 浏览

azure - Which Date to use while generating Azure Bill programmatically using Billing APIs

There are two types of times with the Chargeback reporting data:

  1. Processing Date: Also known as Reported date. It is the Date on which the data is reported in the Azure system.
  2. Usage Start and End Date: This is the actual date when the resource was used in Azure.

E.g. You create a VM in Azure and it was up and running for 5 hours on 8th of April until midnight. Now only 2 of those hours are reported on 8th in Azure. And the remaining 3 hours are reported on 9th of April. So in this case:

  • For first 2 hours, the Processing or Reporting date is 8th April. And the usage date is also 8th April.
  • For the remaining 3 hours: the Processing or Reporting date is 9th April. But the usage date is still 8th April as the actual usage of those hours happened on 8th April.

Now when generating the bill there is no documentation which dates to use. I have three options and their combinations:

  1. Processing or Reported Date
  2. Usage Start Date
  3. Usage End Date

Theoretically, it makes sense to generate the bill using Usage dates. But when I pull the actual bill from https://account.windowsazure.com manually and compare the same to the one generated via APIs, it seems that the bill is being generated in Azure by Reported Date instead.

Ask: Can you please check and confirm that I should be using the Reported Date while generating the billing reports?

0 投票
1 回答
305 浏览

api - RateCARD API MeterID 与 UsageAggregation API MeterID 不匹配

我很难匹配来自 rateCARD API 响应的meterID (GUID) 和来自 UsageAggregation API 响应的meterID。我什至查看了这张表(azure.microsoft.com/de-de/support/guid-migration/),但这也无济于事。UsageAggregatio API 响应中的meterID 与旧 GUID 匹配,但旧 GUID 和新 GUID 都与 rateCARD API 响应中的 id 不匹配。这是我的请求查询。

management.azure.com/subscriptions/{SubID} /providers/Microsoft.Commerce/UsageAggregates?api-version=2015-06-01-preview&reportedstartTime=2016-05-22+00%3a00%3a00Z&reportedEndTime=2016-05-23+ 00%3a00%3a00Z&aggregationGranularity=每日&showDetails=true

management.azure.com/subscriptions/{SubID} /providers/Microsoft.Commerce/RateCard?api-version=2015-06-01-preview&$filter=OfferDurableId%20eq%20'MS-AZR-0025P'%20and%20Currency %20eq%20'EUR'%20and%20Locale%20eq%20'de-DE'%20and%20RegionInfo%20eq%20'DE'

有人可以帮我吗?

更新

这是此类响应的示例。我从 UsageAggregation API 获得带有计量器 ID 的使用聚合。

我没有从 RateCard API 获得该资源的确切条目,这是我能找到的最近的资源。RateCard API 响应中不存在 UsageAggregation API 响应中列出的资源条目。

更新 25.05.2016 优惠 ID 截图

0 投票
1 回答
525 浏览

python - Python 中的 Azure 计费 API - 空响应

我正在尝试在 Python 中构建一个(我认为会是)一个简单的脚本,以使用 Billing API 下载 Microsoft 的 Azure 价目表。

查询似乎正在正确执行。授权似乎没问题,我收到了 200 OK 消息响应。但输出为空:{u'value': []}。我尝试了不同的 OfferID,不同的 $filter 字符串,现在它让我发疯了......

我想知道是否可能我没有委派合适的权限,但我创建了一个附加到 Active Directory 的应用程序,生成了一个密钥,并将权限委派给了 Windows Azure 服务管理?如果这是问题所在,我不会收到错误吗?

很高兴听到做同样事情的其他方法,但 Python 是我真正知道的...

0 投票
2 回答
284 浏览

azure - Azure 计费 API:需要输入哪些确切的详细信息

很抱歉在这里问了一个非常蹩脚的问题。毫无疑问,API 示例代码非常具有描述性。但是每次我运行它时,构建都会失败。错误显示“错误 CS1029:#error:'请更新 app.config 中的 appSettings 部分,然后删除此语句'”

所以这里的问题是这里有什么细节:

ADALRedirectURL= 我提到了相同的“//localhost/”

Tenantdomain= 我输入了默认目录域,例如 xyzqwerty1234@onmicrosoft.com

SubscriptionID= 从 login-azurermaccount 获得

ClientID= 来自目录页面。

请建议我输入的值是否不正确或什么:(顺便说一句,我的订阅是 MicrosoftPartnerNetwork 订阅我希望那不是问题。

提前致谢。

0 投票
0 回答
427 浏览

azure - Azure CLI - 获取 RateCard 信息

我可以从此处记录的 Azure REST API 获取 RateCard 信息:

https://msdn.microsoft.com/en-us/library/azure/mt218998.aspx

是否可以使用 Azure 的命令行界面获取相同的信息?

根据我的研究,我只看到了一个获取使用信息的命令:

0 投票
0 回答
194 浏览

azure - Azure - 用于获取当前费用和计费周期的 API

我们可以从 Azure 门户查看当前费用明细和消耗率。是否有任何 API(除了 RateCard 和 Utilization api)来获取它?我们可以使用 API 获取每个资源的实际成本,而不是计算成本吗?

其次,是否有任何 API 来获取订阅的计费周期?我认为我们需要计费周期来获取成本,如果资源有分层定价,如果我们使用费率和利用率 API,则可以免费使用。

0 投票
1 回答
129 浏览

azure - Azure 使用和计费门户 DataGenStatus 始终挂起

我已经完成教程 Azure Usage and Billing Insights (AUBI) Portal https://github.com/Microsoft/AzureUsageAndBillingPortal中描述的所有过程 没有问题,但在仪表板网站的最后,数据生成状态始终是Pending因为这个有一些 power bi 表是空的,例如 AzureUsageRecords、ReportRequests 和 Reports。有谁知道为什么会导致这个问题?非常感谢你,我希望你的回答。

0 投票
2 回答
496 浏览

azure - US GOV EA 订阅是否支持 Azure 使用情况和价目表 API?

我有一个拥有 Azure 订阅的客户,位于美国 GOV 数据中心。此订阅在 EA 下(不是现收现付)。

尝试使用标准计费 API(价目表和使用情况)失败,并出现“未找到订阅”错误。即运行以下内容:

失败:

我发现有关 EA 帐户的价目表和使用 API 的信息非常少,关于在美国政府 Azure 区域中运行的帐户的这些 API 的信息甚至更少。有谁知道这是否应该工作?