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_SAMESITE"] = "Lax"
    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()
    csrf = CSRFProtect()
    csrf.init_app(flask_app)
    db = SQLA()
    db.session = settings.Session
    db.init_app(flask_app)
    init_dagbag(flask_app)
    cache_config = {"CACHE_TYPE": "flask_caching.backends.filesystem", "CACHE_DIR": gettempdir()}
    Cache(app=flask_app, config=cache_config)
    configure_logging()
    configure_manifest_files(flask_app)
    import_all_models()
    with flask_app.app_context():
        init_error_handlers(flask_app)
        init_api_internal(flask_app, standalone_api=True)
        init_jinja_globals(flask_app)
        init_xframe_protection(flask_app)
    return flask_app
def cached_app(config=None, testing=False):
    """Return cached instance of Airflow Internal API app"""
    global app
    if not app:
        app = create_app(config=config, testing=testing)
    return app