Skip to content

Latest commit

 

History

History
34 lines (28 loc) · 671 Bytes

change-the-route-prefix-for-an-azure-function.md

File metadata and controls

34 lines (28 loc) · 671 Bytes

Change The Route Prefix For An Azure Function

Category: Azure

Azure functions use /api as the route prefix (context root) by default. You can either remove this from the path or use an alternative value by editing the host.json file for your function.

Edit host.json to remove the route prefix from the path:

{
  "version": "2.0"
  //...
  "extensions": {
    "http": {
      "routePrefix": ""
    }
  }
  //..
}

Edit host.json to use a different route prefix. In the following configuration, /service will be used:

{
  "version": "2.0", 
  //...
  "extensions": {
    "http": {
      "routePrefix": "/service"
      }
  }
}