@Anonymous - Welcome to Microsoft Q&A and thanks for reaching out to us.
Most likely the JobId values should be in string format to get the same results as the ones in Azure cost Management Analysis service.
Please modify your JSON to have the JobId values in a string format as below.
[
{
"value": "jobid1,jobid2,jobid3", "label":"App1"
},
{
"value": "jobid1,jobid2,jobid3" , "label": "App2"
}
]
Once you have modified your JSON, you can update your request body to use the correct jobid values as below:
{
"type": "Usage",
"timeframe": "MonthToDate",
"dataset": {
"granularity": "Daily",
"filter": {
"tags" : {
"name" : "jobid",
"operator" : "In",
"values" : "{Application:escapejson}"
}
},
"aggregation": { "totalCost": {"name": "Cost","function": "Sum"}},
"grouping": [
{
"type": "TagKey",
"name": "jobid"
}
]
}
}
Make sure to replace the {Application:escapejson}
parameter with the correct jobid values in a string format.
If you are still not getting the expected results, you can try to debug your request by checking the API response and comparing it with the results in Azure Cost Management Analysis service. You can also try to modify your request by changing the timeframe or the grouping options to see if it affects the results.
Hope this helps. and please feel free to reach out if you have any further questions.
If the above response was helpful, please feel free to "Accept as Answer" and click "Yes" so it can be beneficial to the community.