Hello @manish verma !
I can see you need to add Date parameters into your API Call to replace this with variable adddays(utcnow(),-1) as start date and utcnow() as end date
Use this for start
@{formatDateTime(adddays(utcnow(),-1), 'yyyy-MM-dd')}
. This expression calculates the date one day before the current UTC date and formats it as 'yyyy-MM-dd'.
And ;
@{formatDateTime(utcnow(), 'yyyy-MM-dd')}
. This expression gets the current UTC date and formats it as 'yyyy-MM-dd'.
At the end combined it should look like this:
https://management.azure.com/subscriptions/{/subscriptionsId}/providers/Microsoft.Consumption/usageDetails?$expand=meterDetails,additionalProperties&$filter=properties/usageEnd ge '@{formatDateTime(adddays(utcnow(),-1), 'yyyy-MM-dd')}' AND properties/usageEnd le '@{formatDateTime(utcnow(), 'yyyy-MM-dd')}' &$top=30&api-version=2019-01-01
Can you please try ? I have not been able to try this out so give it a go and kindly provide your feedback !
I hope this helps!
The answer or portions of it may have been assisted by AI Source: ChatGPT Subscription
Kindly mark the answer as Accepted and Upvote in case it helped!
Regards