gpt4 book ai didi

Azure 函数错误消息 : Method not allowed in this pricing tier

转载 作者:行者123 更新时间:2023-12-03 00:23:55 26 4
gpt4 key购买 nike

我有一个 azure 函数,旨在自动与 API 管理进行交互。

因此,在 Http Trigger 上,它会创建一个 api 管理用户。

这是开发人员层,一切正常 - 我已经测试了它和一切。

enter image description here

自从从开发者层切换到消费层后,我现在在使用过程中收到以下错误。

[6/19/2020 2:37:28 AM] ERROR: New-AzApiManagementUser : 
[6/19/2020 2:37:28 AM] Error Code: MethodNotAllowedInPricingTier
[6/19/2020 2:37:28 AM] Error Message: Method not allowed in this pricing tier
[6/19/2020 2:37:28 AM] Request Id: d6112a6a-c7ab-4648-85f6-74518c2a1351
[6/19/2020 2:37:28 AM]
[6/19/2020 2:37:28 AM] At C:\Users\*******\AzureProjects\course_api_mgmt\course_api_mgmt\run.ps1:48 char:13
[6/19/2020 2:37:28 AM] + $user = New-AzApiManagementUser -Context $context -FirstName $use ...
[6/19/2020 2:37:28 AM] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[6/19/2020 2:37:28 AM] + CategoryInfo : CloseError: (Microsoft.Azure.Man\u2026ase.ExecuteCmdlet():ErrorResponseException) [New-AzApiManagementUser], Exception
[6/19/2020 2:37:28 AM] + FullyQualifiedErrorId : Operation returned an invalid status code 'BadRequest',Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Commands.NewAzureApiManagementUser
[6/19/2020 2:37:28 AM]
[6/19/2020 2:37:28 AM] Script stack trace:
[6/19/2020 2:37:28 AM] at <ScriptBlock>, C:\Users\*******\AzureProjects\course_api_mgmt\course_api_mgmt\run.ps1: line 48
[6/19/2020 2:37:28 AM]
[6/19/2020 2:37:28 AM] System.Exception:
[6/19/2020 2:37:28 AM] Error Code: MethodNotAllowedInPricingTier
[6/19/2020 2:37:28 AM] Error Message: Method not allowed in this pricing tier
[6/19/2020 2:37:28 AM] Request Id: d6112a6a-c7ab-4648-85f6-74518c2a1351
[6/19/2020 2:37:28 AM]
[6/19/2020 2:37:28 AM]
[6/19/2020 2:37:28 AM]
[6/19/2020 2:37:28 AM] Result: ERROR: New-AzApiManagementUser :
[6/19/2020 2:37:28 AM] Error Code: MethodNotAllowedInPricingTier
[6/19/2020 2:37:28 AM] Error Message: Method not allowed in this pricing tier
[6/19/2020 2:37:28 AM] Request Id: d6112a6a-c7ab-4648-85f6-74518c2a1351
[6/19/2020 2:37:28 AM]
[6/19/2020 2:37:28 AM] At C:\Users\*******\AzureProjects\course_api_mgmt\course_api_mgmt\run.ps1:48 char:13
[6/19/2020 2:37:28 AM] + $user = New-AzApiManagementUser -Context $context -FirstName $use ...
[6/19/2020 2:37:28 AM] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[6/19/2020 2:37:28 AM] + CategoryInfo : CloseError: (Microsoft.Azure.Man\u2026ase.ExecuteCmdlet():ErrorResponseException) [New-AzApiManagementUser], Exception
[6/19/2020 2:37:28 AM] + FullyQualifiedErrorId : Operation returned an invalid status code 'BadRequest',Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Commands.NewAzureApiManagementUser
[6/19/2020 2:37:28 AM]
[6/19/2020 2:37:28 AM] Script stack trace:
[6/19/2020 2:37:28 AM] at <ScriptBlock>, C:\Users\*******\AzureProjects\course_api_mgmt\course_api_mgmt\run.ps1: line 48
[6/19/2020 2:37:28 AM]
[6/19/2020 2:37:28 AM] System.Exception:
[6/19/2020 2:37:28 AM] Error Code: MethodNotAllowedInPricingTier
[6/19/2020 2:37:28 AM] Error Message: Method not allowed in this pricing tier
[6/19/2020 2:37:28 AM] Request Id: d6112a6a-c7ab-4648-85f6-74518c2a1351
[6/19/2020 2:37:28 AM]
[6/19/2020 2:37:28 AM]
[6/19/2020 2:37:28 AM]
Exception:
[6/19/2020 2:37:28 AM] Error Code: MethodNotAllowedInPricingTier
[6/19/2020 2:37:28 AM] Error Message: Method not allowed in this pricing tier
[6/19/2020 2:37:28 AM] Request Id: d6112a6a-c7ab-4648-85f6-74518c2a1351
[6/19/2020 2:37:28 AM]
Stack: .
[6/19/2020 2:37:29 AM] INFORMATION:
[6/19/2020 2:37:29 AM] ERROR: New-AzApiManagementSubscription : Cannot validate argument on parameter 'UserId'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
[6/19/2020 2:37:29 AM] At C:\Users\*******\AzureProjects\course_api_mgmt\course_api_mgmt\run.ps1:61 char:71
[6/19/2020 2:37:29 AM] + ... -AzApiManagementSubscription -Context $context -UserId $user.UserId `
[6/19/2020 2:37:29 AM] + ~~~~~~~~~~~~
[6/19/2020 2:37:29 AM] + CategoryInfo : InvalidData: (:) [New-AzApiManagementSubscription], ParameterBindingValidationException
[6/19/2020 2:37:29 AM] + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Commands.NewAzureApiManagementSubscription
[6/19/2020 2:37:29 AM]
[6/19/2020 2:37:29 AM] Script stack trace:
[6/19/2020 2:37:29 AM] at <ScriptBlock>, C:\Users\*******\AzureProjects\course_api_mgmt\course_api_mgmt\run.ps1: line 61
[6/19/2020 2:37:29 AM]
[6/19/2020 2:37:29 AM] System.Management.Automation.ParameterBindingValidationException: Cannot validate argument on parameter 'UserId'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
[6/19/2020 2:37:29 AM] at System.Management.Automation.ParameterBinderBase.BindParameter(CommandParameterInternal parameter, CompiledCommandParameter parameterMetadata, ParameterBindingFlags flags)
[6/19/2020 2:37:29 AM] at System.Management.Automation.CmdletParameterBinderController.BindParameter(CommandParameterInternal argument, MergedCompiledCommandParameter parameter, ParameterBindingFlags flags)
[6/19/2020 2:37:29 AM] at System.Management.Automation.CmdletParameterBinderController.BindParameter(UInt32 parameterSets, CommandParameterInternal argument, MergedCompiledCommandParameter parameter, ParameterBindingFlags
flags)
[6/19/2020 2:37:29 AM] at System.Management.Automation.CmdletParameterBinderController.BindParameters(UInt32 parameterSets, Collection`1 arguments)
[6/19/2020 2:37:29 AM] at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParametersNoValidation(Collection`1 arguments)
[6/19/2020 2:37:29 AM] at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParameters(Collection`1 arguments)
[6/19/2020 2:37:29 AM] at System.Management.Automation.CommandProcessor.BindCommandLineParameters()
[6/19/2020 2:37:29 AM] at System.Management.Automation.CommandProcessor.Prepare(IDictionary psDefaultParameterValues)
[6/19/2020 2:37:29 AM] at System.Management.Automation.CommandProcessorBase.DoPrepare(IDictionary psDefaultParameterValues)
[6/19/2020 2:37:29 AM] at System.Management.Automation.Internal.PipelineProcessor.Start(Boolean incomingStream)
[6/19/2020 2:37:29 AM] at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)
[6/19/2020 2:37:29 AM] --- End of stack trace from previous location where exception was thrown ---
[6/19/2020 2:37:29 AM] at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)
[6/19/2020 2:37:29 AM] at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)
[6/19/2020 2:37:29 AM] at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)
[6/19/2020 2:37:29 AM] at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
[6/19/2020 2:37:29 AM] at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
[6/19/2020 2:37:29 AM]
[6/19/2020 2:37:29 AM] Inner exception: System.Management.Automation.ValidationMetadataException: The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
[6/19/2020 2:37:29 AM] at System.Management.Automation.ValidateNotNullOrEmptyAttribute.Validate(Object arguments, EngineIntrinsics engineIntrinsics)
[6/19/2020 2:37:29 AM] at System.Management.Automation.ParameterBinderBase.BindParameter(CommandParameterInternal parameter, CompiledCommandParameter parameterMetadata, ParameterBindingFlags flags)
[6/19/2020 2:37:29 AM]
[6/19/2020 2:37:29 AM]
[6/19/2020 2:37:29 AM] Result: ERROR: New-AzApiManagementSubscription : Cannot validate argument on parameter 'UserId'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
[6/19/2020 2:37:29 AM] At C:\Users\*******\AzureProjects\course_api_mgmt\course_api_mgmt\run.ps1:61 char:71
[6/19/2020 2:37:29 AM] + ... -AzApiManagementSubscription -Context $context -UserId $user.UserId `
[6/19/2020 2:37:29 AM] + ~~~~~~~~~~~~
[6/19/2020 2:37:29 AM] + CategoryInfo : InvalidData: (:) [New-AzApiManagementSubscription], ParameterBindingValidationException
[6/19/2020 2:37:29 AM] + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Commands.NewAzureApiManagementSubscription
[6/19/2020 2:37:29 AM]
[6/19/2020 2:37:29 AM] Script stack trace:
[6/19/2020 2:37:29 AM] at <ScriptBlock>, C:\Users\Aubrey\AzureProjects\course_api_mgmt\course_api_mgmt\run.ps1: line 61
[6/19/2020 2:37:29 AM]
[6/19/2020 2:37:29 AM] System.Management.Automation.ParameterBindingValidationException: Cannot validate argument on parameter 'UserId'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
[6/19/2020 2:37:29 AM] at System.Management.Automation.ParameterBinderBase.BindParameter(CommandParameterInternal parameter, CompiledCommandParameter parameterMetadata, ParameterBindingFlags flags)
[6/19/2020 2:37:29 AM] at System.Management.Automation.CmdletParameterBinderController.BindParameter(CommandParameterInternal argument, MergedCompiledCommandParameter parameter, ParameterBindingFlags flags)
[6/19/2020 2:37:29 AM] at System.Management.Automation.CmdletParameterBinderController.BindParameter(UInt32 parameterSets, CommandParameterInternal argument, MergedCompiledCommandParameter parameter, ParameterBindingFlags
flags)
[6/19/2020 2:37:29 AM] at System.Management.Automation.CmdletParameterBinderController.BindParameters(UInt32 parameterSets, Collection`1 arguments)
[6/19/2020 2:37:29 AM] at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParametersNoValidation(Collection`1 arguments)
[6/19/2020 2:37:29 AM] at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParameters(Collection`1 arguments)
[6/19/2020 2:37:29 AM] at System.Management.Automation.CommandProcessor.BindCommandLineParameters()
[6/19/2020 2:37:29 AM] at System.Management.Automation.CommandProcessor.Prepare(IDictionary psDefaultParameterValues)
[6/19/2020 2:37:29 AM] at System.Management.Automation.CommandProcessorBase.DoPrepare(IDictionary psDefaultParameterValues)
[6/19/2020 2:37:29 AM] at System.Management.Automation.Internal.PipelineProcessor.Start(Boolean incomingStream)
[6/19/2020 2:37:29 AM] at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)
[6/19/2020 2:37:29 AM] --- End of stack trace from previous location where exception was thrown ---
[6/19/2020 2:37:29 AM] at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)
[6/19/2020 2:37:29 AM] at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)
[6/19/2020 2:37:29 AM] at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)
[6/19/2020 2:37:29 AM] at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
[6/19/2020 2:37:29 AM] at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
[6/19/2020 2:37:29 AM]
[6/19/2020 2:37:29 AM] Inner exception: System.Management.Automation.ValidationMetadataException: The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
[6/19/2020 2:37:29 AM] at System.Management.Automation.ValidateNotNullOrEmptyAttribute.Validate(Object arguments, EngineIntrinsics engineIntrinsics)
[6/19/2020 2:37:29 AM] at System.Management.Automation.ParameterBinderBase.BindParameter(CommandParameterInternal parameter, CompiledCommandParameter parameterMetadata, ParameterBindingFlags flags)
[6/19/2020 2:37:29 AM]
[6/19/2020 2:37:29 AM]
Exception: Cannot validate argument on parameter 'UserId'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
Stack: at System.Management.Automation.ParameterBinderBase.BindParameter(CommandParameterInternal parameter, CompiledCommandParameter parameterMetadata, ParameterBindingFlags flags)
[6/19/2020 2:37:29 AM] at System.Management.Automation.CmdletParameterBinderController.BindParameter(CommandParameterInternal argument, MergedCompiledCommandParameter parameter, ParameterBindingFlags flags)
[6/19/2020 2:37:29 AM] at System.Management.Automation.CmdletParameterBinderController.BindParameter(UInt32 parameterSets, CommandParameterInternal argument, MergedCompiledCommandParameter parameter, ParameterBindingFlags
flags)
[6/19/2020 2:37:29 AM] at System.Management.Automation.CmdletParameterBinderController.BindParameters(UInt32 parameterSets, Collection`1 arguments)
[6/19/2020 2:37:29 AM] at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParametersNoValidation(Collection`1 arguments)
[6/19/2020 2:37:29 AM] at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParameters(Collection`1 arguments)
[6/19/2020 2:37:29 AM] at System.Management.Automation.CommandProcessor.BindCommandLineParameters()
[6/19/2020 2:37:29 AM] at System.Management.Automation.CommandProcessor.Prepare(IDictionary psDefaultParameterValues)
[6/19/2020 2:37:29 AM] at System.Management.Automation.CommandProcessorBase.DoPrepare(IDictionary psDefaultParameterValues)
[6/19/2020 2:37:29 AM] at System.Management.Automation.Internal.PipelineProcessor.Start(Boolean incomingStream)
[6/19/2020 2:37:29 AM] at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)
[6/19/2020 2:37:29 AM] --- End of stack trace from previous location where exception was thrown ---
[6/19/2020 2:37:29 AM] at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)
[6/19/2020 2:37:29 AM] at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)
[6/19/2020 2:37:29 AM] at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)
[6/19/2020 2:37:29 AM] at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
[6/19/2020 2:37:29 AM] at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame).
[6/19/2020 2:37:29 AM] OUTPUT:
[6/19/2020 2:37:30 AM] Executed 'Functions.course_api_mgmt' (Failed, Id=e500bbdd-bac7-49cc-9076-5ff11c8d440c)
[6/19/2020 2:37:30 AM] System.Private.CoreLib: Exception while executing function: Functions.course_api_mgmt. System.Private.CoreLib: Result: Failure
Exception: Object reference not set to an instance of an object.
Stack: at Microsoft.Azure.Functions.PowerShellWorker.Utility.TypeExtensions.DeriveContentType(HttpResponseContext httpResponseContext, RpcHttp rpcHttp) in C:\projects\azure-functions-powershell-worker\src\Utility\TypeExtensions.cs:line 196
[6/19/2020 2:37:30 AM] at Microsoft.Azure.Functions.PowerShellWorker.Utility.TypeExtensions.ToRpcHttp(HttpResponseContext httpResponseContext) in C:\projects\azure-functions-powershell-worker\src\Utility\TypeExtensions.cs:line 188
[6/19/2020 2:37:30 AM] at Microsoft.Azure.Functions.PowerShellWorker.Utility.TypeExtensions.ToTypedData(Object value) in C:\projects\azure-functions-powershell-worker\src\Utility\TypeExtensions.cs:line 242
[6/19/2020 2:37:30 AM] at Microsoft.Azure.Functions.PowerShellWorker.RequestProcessor.BindOutputFromResult(InvocationResponse response, AzFunctionInfo functionInfo, Hashtable results) in C:\projects\azure-functions-powershell-worker\src\RequestProcessor.cs:line 466
[6/19/2020 2:37:30 AM] at Microsoft.Azure.Functions.PowerShellWorker.RequestProcessor.ProcessInvocationRequestImpl(StreamingMessage request, AzFunctionInfo functionInfo, PowerShellManager psManager, FunctionInvocationPerformanceStopwatch stopwatch) in C:\projects\azure-functions-powershell-worker\src\RequestProcessor.cs:line 306.

当我决定切换时,我在查看层之间的差异时并没有注意到这一点,但错误消息似乎非常简单。有人可以确认我确实无法在消费层 API 管理实例的上下文中运行命令 New-AzApiManagementUser 吗?

如果没有,是否有任何方法可以在消费层自动创建 API 管理用户?

最佳答案

不,你不能。根据文档,消费层不支持“直接管理API”。

https://learn.microsoft.com/en-us/azure/api-management/api-management-features

关于Azure 函数错误消息 : Method not allowed in this pricing tier,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62462539/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com