Unable to get Azure Consumption Detail
Currently , the Powershell API to get subscription consumption details only supports Enterprise Subscriptions. There is also a Github Issue for the same.
I tried the same operation on 2 of my subscriptions :
If You run command with debug then you can also see why it is giving bad request :
Get-AzConsumptionUsageDetail -BillingPeriodName 202202-1 -debug
Update :
As Gokulnath Kumar mentioned , In Pay-as-you-go
subscription it seems to work if provide start date
and end date
with the command as per your Billing Period Start Date and Billing Period End Date like below :
Get-AzConsumptionUsageDetail -StartDate 2021-11-27 -EndDate 2021-12-26