Closed
Description
Using a technique called DispatcherMiddleware
it is possible to mount a Flask app only at an arbitrary prefix path.
Would it be possible for the http_app_func
to manage only this mount path so that the app can register other HTTP endpoints (using durable functions and orchestrators for example)
import azure.functions as func
from werkzeug.serving import run_simple
from werkzeug.middleware.dispatcher import DispatcherMiddleware
flask_app = Flask(__name__)
@flask_app.get("/")
def hello():
return Response(f"<h1>Hello World</h1>", mimetype="text/html")
flask_app.wsgi_app = DispatcherMiddleware(run_simple, {'/abc/123': flask_app.wsgi_app})
# see https://stackoverflow.com/a/18967744/1360476
app = func.WsgiFunctionApp(app=flask_app.wsgi_app, http_auth_level=func.AuthLevel.ANONYMOUS)
# app.register_blueprint(other_http_bp_here)
It appears every routes become managed by http_app_func
because of the constant route template below.
azure-functions-python-library/azure/functions/decorators/function_app.py
Lines 2842 to 2847 in b85eb7a
Moreover using the host.json
file it looks like it is only possible to set the $.extensions.http.routePrefix
globally
Metadata
Metadata
Assignees
Labels
No labels