我正在尝试通过AZ脚本导入WebSocket API。
如Microsoft doc here中所述,此API包含根级别的onHandshake方法。
$operationDst = New-AzApiManagementOperation
-Context $apimDstContext
-ApiId $fullApiId
-ApiRevision $api.ApiRevision
-Name $operation.Name
-OperationId $operation.OperationId
-Method $operation.Method
-Description $opDescription
-UrlTemplate $urlTemplate
-Request $requestDst
-Responses $responsesDst
-Debug -Verbose -ErrorAction Break;
问题是导入此方法时,-urltemplate参数值为“”,并且我一直收到此错误:
System.Management.Automation.ParameterBindingValidationException: Cannot validate argument on parameter 'UrlTemplate'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
我试着将它设置为$null,这样就不会更好了,然后“/”会给我这个错误:
"Operation entity cannot be defined by user for web socket api type."
1条答案
按热度按时间qhhrdooz1#
实际上,onHandshake方法是在创建WebSocket时自动添加的,所以我应该忽略该方法的导入