Azure Service Fabric REST API-“将服务包部署到节点”请求导致“ 500序列化错误”

时间:2019-03-14 08:38:44

标签: rest azure-service-fabric

我正在尝试使用Azure Functions应用中的REST API方法Deploy Service Package To Node。我的服务结构群集请求失败并出现错误

  

远程服务器返回错误:(500)SerializationError。

请求的URI和正文已通过以下方法构建:

// Uri
string uri = string.Format( "https://{0}/Nodes/{1}/$/DeployServicePackage?api-version={2}&timeout={3}",
        this.ClusterConnection, nodeName, apiVersion, timeout );

// Request body
dynamic jsonBody = new JObject();
jsonBody.ServiceManifestName = this.ServiceManifestName;
jsonBody.ApplicationTypeName = this.ApplicationTypeName;
jsonBody.ApplicationTypeVersion = this.ApplicationTypeVersion;
jsonBody.NodeName = nodeName;

// Serialize body.
string body = JsonConvert.SerializeObject( jsonBody );

// Invoke request
InvokePost( uri, body );

我对成功执行的其他Service Fabric REST API请求Provision Application Type使用了类似的方法。

当我比较失败和成功的请求时,调试URI和参数不会显示任何内容。

失败请求-将服务包部署到节点(URI +正文):

https://mycluster.westeurope.cloudapp.azure.com:19080/Nodes/_nt1vm_2/$/DeployServicePackage?api-version=6.0&timeout=60

{
"ServiceManifestName": "MyContainerPkg",
"ApplicationTypeName": "MyContainer",
"ApplicationTypeVersion": "1.0.0",
"NodeName": "_nt1vm_2"
}

成功请求-设置应用程序类型(URI +正文):

https://mycluster.westeurope.cloudapp.azure.com:19080/ApplicationTypes/$/Provision?api-version=6.2&timeout=60

{
  "Kind": "ImageStorePath",
  "ApplicationTypeBuildPath": "MyContainer",
  "ApplicationPackageCleanupPolicy": "Automatic"
}

0 个答案:

没有答案