You can also use the capabilities of Azure Function Proxies to do this, which might be better if you want to clearly indicate which methods or routes you want to get.
Just create a file proxy.jsonand add the following JSON fragment to it.
{
"$schema": "http://json.schemastore.org/proxies",
"proxies": {
"myazurefunctionproxy": {
"matchCondition": {
"methods": ["GET"],
"route": "/{slug}"
},
"backendUri": "https://%WEBSITE_HOSTNAME%/api/{slug}"
},
}
}
This sample redirects all GET requests to a route with a prefix /api/.
source
share