Search code examples
bindingazure-functionsazure-storage

How to reduce CreateTable transaction when use Azure function binding?


Currently, my project is using Azure function 2.x. I'm binding TableStorage to CloudTable. Function is triggered by Eventhub message

However, there are many CreateTable transactions. See picture below: enter image description here

This transaction seem happens for every function invoke. Check the source of in Github, that call the method: CreateIfNotExists() when binding, so I guess it can be the root cause of this behavior above. It is strange, too much CreateTable transactions does not happen in Azure function 1.x

Is there anyway to reduce CreateTable transaction? May I need to use custom binding?

Thanks in advance.


Solution

  • There are many CreateTable transactions.

    The reason why have so many CreateTable transactions is because the underlying code is trying to create.

    Is there anyway to reduce CreateTable transaction? May I need to use custom binding?

    I am not sure what language you are using now, if you try to use C# IBinder, maybe you will still run the create step. You can create your own logic in the body of function, I think this can perfectly avoid this problem. Just try to get it instead of create it.