1

I am following the blog, to fetch usage details for my subscription.

https://blogs.technet.microsoft.com/keithmayer/2015/06/30/export-azure-subscription-usage-to-csv-with-new-billing-api-and-powershell/

"Export Azure Usage via PowerShell using Get-UsageAggregates" (part 1)

I am getting the below error:

Get-UsageAggregates : InvalidInput: Parameter continuationtoken was missing or had an unacceptable value.
At line:30 char:18
+ ... usageData = Get-UsageAggregates -ReportedStartTime $reportedStartTime ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Get-UsageAggregates], CloudException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.UsageAggregates.GetUsageAggregatesCommand

If anyone has worked around this, please let me know how to solve this?

Manjunath Rao
  • 1,397
  • 4
  • 26
  • 42
  • I would recommend using the UsageDetails API instead of UsageAggregates. UsageAggregates isn't being maintained. https://learn.microsoft.com/rest/api/consumption/usagedetails/list – Michael Flanakin May 23 '19 at 17:30

1 Answers1

1

I replaced "" with $null and it seems to be working for the continuationToken.

Manjunath Rao
  • 1,397
  • 4
  • 26
  • 42