The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi All,
I am developing a billing/costing report using powershell where i am calling by API. Here is the API that i am using ( https://management.azure.com//subscriptions/xxxxxxxxxxxxxxxx//providers/Microsoft.Consumption/usageD... eq '+"'$yesterdayUtcTime'"+ '&api-version=2021-10-01)
For the $yesterdayUtcTime i am passing it by a variable ($yesterdayUtcTime=$time.ToUniversalTime().AddMonths(-1).ToString("yyyy-MM-ddT00:00:00.0000000Z").
1) Now, i want the API to be worked like, i need to pass the dates specifically, that means data i need is between 2 dates.
2) Also i need to call the API for last 30/60/90 days like that. means the data to be loaded for the last 30/60/90 days at a time.
Could any one please help on this.. I have tried few methods but none of them worked.
Thanks,
Sudharshan.
Hi @Sudharshan1919 ,
It seems that you can achieve your goal by setting the URL Parameter scope:
The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'.
Try something like: billingPeriods/202209
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Sudharshan1919 ,
The $filter may be used to filter usageDetails by properties/resourceGroup, properties/resourceName, properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). PublisherType Filter accepts two values azure and marketplace and it is currently supported for Web Direct Offer Type.
Here are some examples: Examples , hope it would help you.
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
My scenario is like, if i want to get the data in between 2 dates like start date and end date.
Ex: date between 2022-09-01 to 2022-09-31 - 1 months
Please suggest on this.
Thanks,
Thanks