I'm using Azure Forecast Cost Management API to try to retrieve the forecast cost shown in the azure portal like below.
This is the API I'm using -> https://learn.microsoft.com/en-us/rest/api/cost-management/forecast/usage?tabs=HTTP
This is my request body looks like
{
"Dataset": {
"Aggregation": {
"TotalCost": {
"Function": "Sum",
"Name": "Cost"
}
},
"Granularity": "Monthly"
},
"TimePeriod": {
"From": "2023-02-01",
"To": "2023-02-28"
},
"Timeframe": "Custom",
"Type": "Usage"
}
Everything is working if i did the request not in the 1st day of month. But when i make a request to API in 1st day of month, the request is success and the API give me a response, but i can't find any information related to forecast cost amount.
I can see the forecast cost from the Azure portal, so i believe there must be a way to retrieve the data. Help me please?
Thanks.
I have try to modify the timeframe, granularity, and others in the request body. But still can't get the data.