[英]Adding a websocket operation in APIM with powershell at root level
我正在嘗試通過 Az 腳本導入 Websocket Api。
如此處的 Microsoft 文檔中所述, 此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."
實際上onHandshake方法是在創建Websocket Api時自動添加的。所以我應該忽略那個方法的導入
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.