azureazure-functionscsx

Do we pay for compilation time for .csx files used on Azure Functions?


I am currently learning for new Microsoft certification and this snippet from Azure Functions documentation caught my attention (link):

The Azure Functions Tools provides the following benefits:

  • Edit, build, and run functions on your local development computer.
  • Publish your Azure Functions project directly to Azure.
  • Use WebJobs attributes to declare function bindings directly in the C# code instead of maintaining a separate function.json for binding definitions.
  • Develop and deploy pre-compiled C# functions. Pre-complied functions provide a better cold-start performance than C# script-based functions.
  • Code your functions in C# while having all of the benefits of Visual Studio development.

I understand cold-start performance refers to the fact csx files have to be compiled before they are used.

I begun to wonder if there is a cost (price-wise) of compiling csx and if it exists is it even meaningful? If it is done only once for given version of Function then it shouldn't be a noticable.


Solution

  • I don't know if you pay for the compilation time, but I would definitely assume so.

    I do know the answer to "is it a meaningful cost". On a consumption pricing plan, the service will typically stay "warm" for about 20 minutes after an invocation (unofficial, not guaranteed). So, if you generally invoke less than every 20 minutes then you are likely to pay the compilation cost on each invocation. But, given the cost of the time and the frequency it will add up to very little cost over time; not a cost I would personally consider meaningful.