Open
Description
This work is partially done already, but we are open to changes so I want an issue for potential feedback and to track any remaining work.
The main idea is that we want users to provide information (i.e. hooks and functions) programmatically, meaning we need to define an API in which they can do that. As a part of the hooks feature, we settled on a "built-in" module named @azure/functions-core
. See here for some more background. Here is example usage as described in #548:
import { registerHook } from '@azure/functions-core';
registerHook('preInvocation', (context: PreInvocationContext) => {
});
The main alternative we have considered is for the user to return hooks/functions in a startup file as a module export. Example usage described here.
Remaining work
- Create and publish a
@types/azure_functions-core
package - Improve es modules support. Currently users have to use
require
instead ofimport
(workaround here)