I am looking for a PowerShell cmdlet or API, which can give me the cost of the Managed Disk as we can see from the Azure Portal
Asked
Active
Viewed 953 times
-2
-
Could you please provide a sample image/ – Jim Xu Jan 05 '21 at 09:04
-
How's going ? Has your issue got solved ? – Stanley Gong Jan 07 '21 at 02:15
1 Answers
0
You can call the Azure cost management query API to get the real cost of your Managed Disks.
The request of API calling :
You can also use QueryFilter in query dataset to get the result you need directly.
You can also Azure PowerShell to do this. Details see here.

Stanley Gong
- 11,522
- 1
- 8
- 16
-
Thanks for your response, I am looking for an API to gives me the estimate of cost/month upon selection of VMSize, as we see it in the Azure Portal upfront before procuring the VM – Krishna Avinash Chunduru Jan 07 '21 at 06:49
-
As far as I know, the API that estimate of cost/month for a VM is not a public one. So if you want to finish this kind of things, you need to calculate the cost yourself by code. Basically, we could get the Azure billing rate list by this API: https://learn.microsoft.com/en-us/azure/cost-management-billing/manage/usage-rate-card-overview#azure-resource-ratecard-api-preview and calculate the cost:30*24hours* vm prcice for each hour – Stanley Gong Jan 07 '21 at 09:27
-
@KrishnaAvinashChunduru, if my post is helpful,please click on the check mark beside the answer to toggle it from greyed out to filled in to mark it as an answer, so that it will help others and close this query . If you have any more questions, just open a new question and let me know the link :) – Stanley Gong Jan 07 '21 at 09:28
-
@KrishnaAvinashChunduru, how's going ? Has your issue got solved? – Stanley Gong Jan 08 '21 at 08:35