I have resolved it myself.
For anyone who encounters the same problem as me, you can opt-out of the automatic upgrade to v3 by setting the FUNCTIONS_EXTENSION_VERSION
to ~2.0
.
More information could be found here:
https://github.com/Azure/azure-functions-host/wiki/Platform-upgrade-from-Azure-Functions-runtime-v2-to-v3#opting-out-of-the-upgrade