In a C# script-based Function App, adding a new file to one of the functions will not make it available to other functions in the application.
To share code between functions, we will need to do the following two things:
- Create a folder named Shared at the root level of a Function App, and add shared code files to this folder. The WebJobs SDK (that Azure Functions are based on) watches for any code changes in the Shared folder and makes sure that the changes are picked up by the functions.
- Create #load directives to the specific location of the shared files in each function that references the shared code.
You can add other folders to the function's watch list by modifying the watchDirectories setting of the WebJobs host here at https://github.com/Azure/azure-webjobs-sdk-script/wiki/host.json.
To show an example of the process, we will create...