I'm trying to estimate costs of Azure Functions. One thing that stays unclear for me is how exactly time execution of a function is being measured. I mean here an Azure Function that uses some binding such as Azure Cosmos DB Binding or File Storage binding.
For instance, I have a node.js azure function with outputBinding:
module.exports = function (context) {
context.bindings.employeeDocument = JSON.stringify({
id: context.bindings.myQueueItem.name + "-" + context.bindings.myQueueItem.employeeId,
name: context.bindings.myQueueItem.name,
employeeId: context.bindings.myQueueItem.employeeId,
address: context.bindings.myQueueItem.address
});
context.done();
};
We set output binding to property "employeeDocument" and the data is being saved into DB after function returns. The question is: what happens after above block of code (saving to DB, maybe within some transaction, maybe other operations required for DB save) is it also counted as a time of execution of azure function? In other words, do we pay also for that what happens after we leave function block but was triggered by function?