zl程序教程

您现在的位置是:首页 >  工具

当前栏目

jMeter创建微软Azure Lambda Function报错

微软 报错 创建 JMeter Function lambda Azure
2023-09-14 09:03:08 时间

同时起10个线程:

创建的function名称为jerryfuncv3_{uuid}, uuid为从1到100之间的随机整数:

测试结果,10次有8次全是400 bad request:

比如这次jerryfuncv3_70就应该是创建失败了:

然而Azure上却能看到这10个成功创建好的function:

所以从结果上看Azure function创建成功了,但不知道Azure host runtime为什么会返回400 bad request…

有时候在Azure portal上手动创建function都会400 error?


{"properties":{"files":{"index.js":"module.exports = async function (context, req) {\r\n    context.log('JavaScript HTTP trigger function processed a request.');\r\n\r\n    if (req.query.name || (req.body && req.body.name)) {\r\n        context.res = {\r\n            // status: 200, /* Defaults to 200 */\r\n            body: \"Hello \" + (req.query.name || req.body.name)\r\n        };\r\n    }\r\n    else {\r\n        context.res = {\r\n            status: 400,\r\n            body: \"Please pass a name on the query string or in the request body\"\r\n        };\r\n    }\r\n};"},"test_data":"{\r\n    \"name\": \"Azure\"\r\n}","config":{"bindings":[{"authLevel":"anonymous","type":"httpTrigger","direction":"in","name":"req","methods":["get","post"]},{"type":"http","direction":"out","name":"res"}],"disabled":false}}}

在Azure API console里调用API也会报错:


错误消息详情:

{
  "Code": "BadRequest",
  "Message": "Encountered an error (InternalServerError) from host runtime.",
  "Target": null,
  "Details": [
    {
      "Message": "Encountered an error (InternalServerError) from host runtime."
    },
    {
      "Code": "BadRequest"
    },
    {
      "ErrorEntity": {
        "Code": "BadRequest",
        "Message": "Encountered an error (InternalServerError) from host runtime."
      }
    }
  ],
  "Innererror": null
}

https://github.com/microsoft/vscode-azurefunctions/issues/1838


要获取更多Jerry的原创文章,请关注公众号"汪子熙":