Update to most current WebApi for Get-AzureRmConsumptionUsageDetail
Cmdlet(s)
Get-AzureRmConsumptionUsageDetail
PowerShell Version
Instructions: to get PowerShell version, type $PSVersionTable and look for the value associated with PSVersion
PSVersion 5.1.16299.98
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.16299.98
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Module Version
PS H:> Get-Module
ModuleType Version Name
Manifest 4.0.0 Azure.Storage Binary 2.0.0.131 AzureAD Manifest 0.3.0 AzureRM.Consumption Script 4.0.0 AzureRM.Profile Manifest 5.0.0 AzureRM.Resources Manifest 4.0.1 AzureRM.Storage Manifest 1.0.0.21 AzureRmStorageTable Manifest 1.0 ITAutomation Manifest 3.1.0.0 Microsoft.PowerShell.Management Manifest 3.0.0.0 Microsoft.PowerShell.Security Manifest 3.1.0.0 Microsoft.PowerShell.Utility Script 1.2 PSReadline
OS Version
Instructions: to get OS version, type $PSversionTable and look for value associated with BuildVersion
BuildVersion 10.0.16299.98
Description
Would it be possible to switch the WebAPI-Version from "2017-04-24-preview" to a more recent one? Like "2018-01-31" The thing is that the current Version does not Support some Azure-Offers.
PS H:> Get-AzureRmConsumptionUsageDetail -StartDate 2018-01-01 -EndDate 2018-01-29 WARNUNG: Offer id MS-AZR-0017P is not supported.
Using fiddler i see requests to https://management.azure.com/subscriptions/f2db5e54-4011-4860-8929-68d48082c84f/providers/Microsoft.Consumption/usageDetails?$filter=usageEnd%20ge%202018-01-01T23%3A59%3A59Z%20and%20usageEnd%20le%202018-01-29T23%3A59%3A59Z&api-version=2017-04-24-preview
This will give the following feedback
{
"error": {
"code": "UnsupportedSubscriptionType",
"target": "MS-AZR-0017P",
"message": "Offer id MS-AZR-0017P is not supported."
}
}
By changing the Version=2018-01-31 i geht the expected response
Debug Output
Instructions: to get Debug Output, set $DebugPreference="Continue" and then execute the cmdlet or script causing the issue
Script/Steps for Reproduction
@twitchax Can you assign this to the appropriate team?
Any updates on this topc?
@Panda-Wang Can you take a look at this?
@MiYanni @Panda-Wang Are there any updates on this topic? I did not expect it to be such a tough task to switch to a more recent API-Version?! Or am I missing something?!
@zimmermannb It can be quite complicated to upgrade API versions. Each service has their own team that manages their own cmdlets/SDK. So, they decide when they want to update their SDK, and that SDK is what the cmdlets are built on.
The good news is that it looks like the Consumption SDK has been updated to API version 2018-01-31. So, it is only a matter of time until that SDK version is put into the PowerShell cmdlets.
@wilcobmsft Hey Wilco, would you mind taking a look at this issue?
@zimmermannb .. thanks for bringing this .. yes, we are actively working on upgrading the PowerShell cmdlets to our new Api Version. I will update and close this issue, when we have a new version published.
We have the latest cmdlet Get-AzureRmConsumptionUsageDetail based on API version 2018-01-31. Please refer to the pull request just merged. https://github.com/Azure/azure-powershell/pull/6023 Will close the issue.