我目前正在尝试通过Postman通过REST请求添加Logger。这是我的测试请求:
PUT https://myapimgt.management.azure-api.net/loggers/my-test-logger?api-version=2015-09-15
{
"type" : "AzureEventHub",
"description" : "Sample logger description",
"credentials" : {
"name" : "my-eventhub",
"connectionString" : "sb://my-eventhub-ns.servicebus.windows.net/;SharedAccessKeyName=test-access;SharedAccessKey=bDotPrTAb7loNlCvtXjH8KeM2q4jS3+R4P1x78A4kqs="
}
}
上面的请求返回以下错误对象:
{
"error": {
"code": "InternalServerError",
"message": "Request processing failed due to internal error.",
"details": null
}
}
知道问题是什么或我如何调试?我可以通过不同的邮递员请求获得/记录器没有问题。
答案 0 :(得分:2)
您的连接字符串在开始时缺少“Endpoint =”,因此正确的有效负载应为:
{
"type" : "AzureEventHub",
"description" : "Sample logger description",
"credentials" : {
"name" : "my-eventhub",
"connectionString" : "Endpoint=sb://my-eventhub-ns.servicebus.windows.net/;SharedAccessKeyName=test-access;SharedAccessKey=bDotPrTAb7loNlCvtXjH8KeM2q4jS3+R4P1x78A4kqs="
}
}
我们需要检查为什么没有正确报告此错误并修复它。