Search code examples
azureazure-functionskudu

What is the approach to generate Azure Functions from data and feed into the running environment?


I want to generate Functions code (C# or NodeJS) based on business rules I have in a database and replace the Function so that it is compiled and picked up the next time the Function is invoked.

What could be the approach?

  1. use kudu and write the Functions to the "file system"
  2. use Functions Host Admin API (if available)

Solution

  • Using the Kudu VFS (File System) or ZIP APIs will be the most straight forward approach, I would recommend the latter.

    There are no host APIs for function creation/management today, so that is not a viable option.

    Another option, which depending on your requirements and logic, might be a better fit, is to have a function that creates those files for you. Just need to be careful to make sure you don't have delays in file writes, causing the runtime to process those files before you're done.