azure-sdk-for-go: Error on List function of Consumption Usagedetails

import path ‘services/consumption/mgmt/2018-03-31/consumption’

–pseudo code

List, err := usageClient.List(ctx, expand, filter, skipToken, &top, "")
if err != nil {
	log.Println("Error In Getting Usage List : ")
	log.Println(err.Error())
	log.Println("")
	break
}

getting this error after first iterations using next token. using top value as 1000

consumption.UsageDetailsClient#List: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="400" Message="id query parameter is not a valid Guid (Request ID: 80c46708-2afa-4d1a-b155-f1c692bd0fa6)"

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 22 (10 by maintainers)

Most upvoted comments

So to summarize I think there are several issues here.

  • The List API taking just a skip token isn’t sufficient (you need to pass the ID and likely the skip token version as well).
  • Parsing the skip token out of the next URL is not user-friendly (there might be some ways to simplify this, like getting the skiptoken value directly from the HTTP response object but it’s still not ideal).
  • The nextLink URL provided by the service doesn’t encode the query params so it’s effectively useless.

I would like to avoid having to always round-trip the nextLink URL like this as most services return a valid URL so I will follow up with the service team about getting it fixed. I’ll also bring up the other points to see what can be done about them. As for a more immediate fix it will depend on how fast the service team can turn around fixing the nextLink URL. I’ll discuss with my team and follow up.

That did the work! Thanks. So how does this work … will a new version come out with the fix ?