2021年3月3日星期三

azure functions POST method is not allowed

I developed a web api using azure functions and tested it locally using VS Code using the POST method and it works exactly as I need it to. However when I deploy it (also from VS Code) to prod and test the POST method from postman, I receive a 405 METHOD NOT ALLOWED and it looks like it only works with a GET. I can see the app is up and running from the portal and cannot understand why it is restricted to GET only when i have the following set up:

# function.json    {    "scriptFile": "__init__.py",    "bindings": [      {        "authLevel": "anonymous",        "type": "httpTrigger",        "direction": "in",        "name": "req",        "methods": [          "get",          "post"        ]      },      {        "type": "http",        "direction": "out",        "name": "$return"      }    ]  }  

Any help appreciated. I am also confused about how the web api is deployed under APP Services and not under Function APP. I am guessing Function APP comes under APP services?

https://stackoverflow.com/questions/66466998/azure-functions-post-method-is-not-allowed March 04, 2021 at 08:45AM

没有评论:

发表评论