《Windows Azure Platform 系列文章目錄》html
本文介紹的是國內由世紀互聯運維的Azure China運維
請讀者先看一下以前的文檔內容:Azure EA (1) 查看國內Azure帳單,熟悉和掌握CSV文件的字段名和字段值post
咱們知道,在使用EA Portal的時候,能夠查看三種報表:url
1.查看帳單使用量摘要spa
2.查看帳單每個月報告3d
3.查看帳單高級報告下載rest
在開始使用Azure Billing API以前,咱們須要準備:orm
1.拿到Azure EA的合同編號,以VS57開頭htm
(1)咱們登陸https://ea.azure.cn,查看合約編號。以下圖:blog
2.拿到EA Billing API的API Key
點擊下圖的擴展祕鑰,把祕鑰保存到記事本上
請注意:上面的祕鑰有主密鑰和輔助祕鑰,兩個祕鑰都同時有效
咱們在使用Postman訪問國內Azure Billing API,主要訪問的URL有:
一.查看帳單使用量摘要
1.REST API
Method | Download Request URI |
Get | https://ea.azure.cn/rest/{VSNumber}/usage-report?month={YYYY/MM/DD}&type=Summary |
舉例 | https://ea.azure.cn/rest/V570000000001/usage-report?month=2019/8/14&type=Summary |
2.Request Header
Request Header Key | Value |
Authorization | bearer {API Key} |
3.返回結果
二.查看帳單每個月報告
1.REST API
方法 | Request URL |
Get | https://ea.azure.cn/rest/{VSNumber}/usage-reports |
舉例 | https://ea.azure.cn/rest/V570000000001/usage-reports |
2.Request Header
Request Header Key | Value |
Authorization | bearer {API Key} |
3.返回結果
咱們想查看某個月的詳細信息,好比上圖紅色部分,想查看2018年6月份的信息
URL能夠這樣拼起來:
https://ea.azure.cn/+上面的URL
好比說:https://ea.azure.cn/rest/V57000000001/usage-report?month=2018-06&type=detail&fmt=Csv
Request Header
Request Header Key | Value |
Authorization | bearer {API Key} |
返回結果:
三.查看帳單高級報告下載
目前尚未看到相關的API