I'm trying to add a query into a Workbook in Azure Monitor that queries for the month-to-date usage costs for my Azure subscription.
When I construct the query and run it, I receive the following error message:
BadRequest: Invalid query definition, Dataset is invalid or not supplied.
However, the documentation for this REST API call specifically indicates that the datasets
property of the body is not required.
Docs: https://learn.microsoft.com/en-us/rest/api/cost-management/query/usage
Screenshot of docs:
Here's a screenshot of what my query looks like in the Workbook:
Question: How do I properly construct the body for this request, when the documentation doesn't properly explain it?
Actually, this api-doc provides many examples, you can click any of the example for the request body details.
Take BillingAccountQuery-Modern for example, the request body is as below(you can modify it as per your need):