How to change the base “/api” path on Azure Functions (v2)?

后端 未结 2 835
花落未央
花落未央 2021-01-18 15:32

In azure functions we create the function route / name, but it Always preceded by /api

on the documentation we read:

Note that you did not in

2条回答
  •  一个人的身影
    2021-01-18 15:53

    You are looking for the routePrefix specified in the host.json:

    {
      "http": {
        "routePrefix": "whatever"
      }
    }
    

    You can set this for example using kudu:

    https://.scm.azurewebsites.net/DebugConsole/?shell=powershell
    

    Navigate to site -> wwwroot and edit the host.json


    Note: This does not work for v2. Please use the answer from truongx instead.

提交回复
热议问题