Scheduler/Webserver should never use Internal API, so calling any method decorated with internal_api_call should still execute them locally
flask_app.config["SESSION_COOKIE_HTTPONLY"] = True
    flask_app.config["SESSION_COOKIE_SECURE"] = conf.getboolean("webserver", "COOKIE_SECURE")
    cookie_samesite_config = conf.get("webserver", "COOKIE_SAMESITE")
    if cookie_samesite_config == "":
        warnings.warn(
            "Old deprecated value found for `cookie_samesite` option in `[webserver]` section. "
            "Using `Lax` instead. Change the value to `Lax` in airflow.cfg to remove this warning.",
            RemovedInAirflow3Warning,
        )
        cookie_samesite_config = "Lax"
    flask_app.config["SESSION_COOKIE_SAMESITE"] = cookie_samesite_config
    if config:
        flask_app.config.from_mapping(config)
    if "SQLALCHEMY_ENGINE_OPTIONS" not in flask_app.config:
        flask_app.config["SQLALCHEMY_ENGINE_OPTIONS"] = settings.prepare_engine_args()
    
    flask_app.json_provider_class = AirflowJsonProvider
    flask_app.json = AirflowJsonProvider(flask_app)
    csrf.init_app(flask_app)
    init_wsgi_middleware(flask_app)
    db = SQLA()
    db.session = settings.Session
    db.init_app(flask_app)
    init_dagbag(flask_app)
    init_api_experimental_auth(flask_app)
    init_robots(flask_app)
    cache_config = {"CACHE_TYPE": "flask_caching.backends.filesystem", "CACHE_DIR": gettempdir()}
    Cache(app=flask_app, config=cache_config)
    init_flash_views(flask_app)
    configure_logging()