Closed wangken82 closed 1 year ago
PS C:> resolve-azerror
DEBUG: 2:56:59 PM - ResolveError begin processing with ParameterSet 'AnyErrorParameterSet'.
DEBUG: 2:56:59 PM - using account id 'mingchunwang@cciccat.partner.onmschina.cn'...
DEBUG: 2:56:59 PM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True].
WARNING: Upcoming breaking changes in the cmdlet 'Resolve-AzError' :
The Resolve-Error
alias will be removed in a future release. Please change any scripts that use this alias to use Resolve-AzError
instead.
Note : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking change warning, and other information on breaking changes in Azure
PowerShell.
HistoryId: 11
Message : [InvalidResourceType] : The resource type 'calculatePrice' could not be found in the namespace 'Microsoft.Capacity' for api version '2022-03-01'. The supported api-versions are '2017-11-01,2018-06-01,2019-04-01,2020-10-01-preview,2017-11-01-beta,2018-06-01-beta,2019-04-01-beta,2020-06-01-beta,2020-10-01-beta'. StackTrace : Exception : System.Exception InvocationInfo : {Get-AzReservationQuote_CalculateExpanded} Line : Get-AzReservationQuote -AppliedScopeType 'Shared' -BillingPlan 'Monthly' -billingScopeId '/subscriptions/14f85c74-9b52-4b9d-9848-98bab9178efe' -DisplayName 'yourRIName' -Location 'chinaeast2' -Quantity 1 -ReservedResourceType 'VirtualMachines' -Sku 'Standard_b1ms' -Term 'P1Y' Position : At line:1 char:1
HistoryId : 11
HistoryId: 7
Message : [InvalidResourceType] : The resource type 'calculatePrice' could not be found in the namespace 'Microsoft.Capacity' for api version '2022-03-01'. The supported api-versions are '2017-11-01,2018-06-01,2019-04-01,2020-10-01-preview,2017-11-01-beta,2018-06-01-beta,2019-04-01-beta,2020-06-01-beta,2020-10-01-beta'. StackTrace : Exception : System.Exception InvocationInfo : {Get-AzReservationQuote_CalculateExpanded} Line : Get-AzReservationQuote -AppliedScopeType 'Shared' -BillingPlan 'Monthly' -billingScopeId '/subscriptions/14f85c74-9b52-4b9d-9848-98bab9178efe' -DisplayName 'yourRIName' -Location 'chinaeast2' -Quantity 1 -ReservedResourceType 'VirtualMachines' -Sku 'Standard_b1ms' -Term 'P1Y' Position : At line:1 char:1
HistoryId : 7
HistoryId: 5
Message : SharedTokenCacheCredential authentication unavailable. No accounts were found in the cache.
StackTrace : at Azure.Identity.SharedTokenCacheCredential.1 promptAction, IAzureTokenCache tokenCache, String resourceId) at Microsoft.Azure.Commands.Common.Authentication.Factories.AuthenticationFactory.Authenticate(IAzureAccount account, IAzureEnvironment environment, String tenant, SecureString password, String promptBehavior, Action
1 promptAction, String resourceId)
at Microsoft.Azure.Commands.Common.ContextAdapter.<>cDisplayClass15_0.
HistoryId : 5
The Azure PowerShell team is listening, please let us know how we are doing: https://aka.ms/azpssurvey?Q_CHL=ERROR.
DEBUG: 2:56:59 PM - [ConfigManager] Got [True] from [EnableDataCollection], Module = [], Cmdlet = []. DEBUG: AzureQoSEvent: Module: Az.Accounts:2.10.3; CommandName: Resolve-AzError; PSVersion: 5.1.22621.608; IsSuccess: True; Duration: 00:00:00.1420337 DEBUG: 2:56:59 PM - ResolveError end processing.
Thank you for your feedback. This has been routed to the support team for assistance.
@wangken82 , I believe the new API version has not been deployed to Azure China Cloud. You can try to use Invoke-AzRestMethod
to send request to corresponding API version in your environment.
@dingmeng-xue
Tested using invokeAzrestmethod, I'm not sure how to write the parameters, more likely the new api version dont have the function calculateprice. $Params = @" properties = { "AppliedScopeType": "Shared", "BillingPlan": "Monthly", "billingScopeId": "/subscriptions/14f85c74-9b52-4b9d-9848-98bab9178efe", "DisplayName":"yourRIName", "Location": "eastus", "Quantity": "1", "ReservedResourceType": "VirtualMachines", "Sku": "Standard_b1ms", "Term": "P1Y" } "@ Invoke-AzRestMethod -ResourceProviderName "Microsoft.Capacity" -ResourceType "calculatePrice" -ApiVersion 2022-03-01-Payload $Params -Method PUT
cx concern
@wangken82 Apologies for the late reply. Thanks for reaching out to us and reporting this issue. We are looking into this issue and we will provide an update.
@wangken82 AFAIK Reservations are not supported in China cloud just yet. We have no concrete timeline on when this would be supported. See this: https://azure.microsoft.com/en-us/blog/guarantee-capacity-access-with-ondemand-capacity-reservations-now-in-preview/
@wangken82 I hope you had a chance to look at my above comment. If you need any further assistance on this issue in future, please feel free to reopen this thread. We would be happy to help.
Description
cx using the example got error https://learn.microsoft.com/en-us/powershell/module/az.reservations/get-azreservationquote?view=azps-9.1.0#examples
Get-AzReservationQuote -AppliedScopeType 'Shared' -BillingPlan 'Upfro …
I can reproduce it in lab
Checked the api call, we do support 2022-03-01 version https://learn.microsoft.com/en-us/rest/api/reserved-vm-instances/reservation-order/calculate?tabs=HTTP POST https://management.azure.com/providers/Microsoft.Capacity/calculatePrice?api-version=2022-03-01
It seems the powershell command has bug.
Issue script & Debug output
Environment data
Module versions
Error output