Created
October 3, 2020 00:12
-
-
Save srpomeroy/c5c0e61900c6e6824b9143839a366a83 to your computer and use it in GitHub Desktop.
Microsoft Azure EA Legacy API - Reserved Instance Utilization Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source: https://docs.microsoft.com/en-us/rest/api/billing/enterprise/billing-enterprise-api-reserved-instance-usage | |
$enrollmentId = "" | |
$apiToken = "" | |
$startDate = "" ## yyyy-mm-dd | Example: 2020-10-01 | |
$endDate = "" ## yyyy-mm-dd | Example: 2020-10-01 | |
$uri = "https://consumption.azure.com/v2/enrollments/${enrollmentId}/reservationdetails?startDate=${startDate}&endDate=${endDate}" | |
Invoke-RestMethod -Method Get -UseBasicParsing -Uri $uri -Headers @{"Authorization"="bearer ${apiToken}"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment