0
votes

Can I safely use lock{} inside Azure AcitityTrigger and HttpTrigger functions or I have to work it around?

1

1 Answers

0
votes

While I don't see why it shouldn't work, note that this would work only in the context of a single instance and won't hold when your app scales out.

Across function app instances, you will have to go for a distributed lock like using storage blob leases.

Also, it's better to leverage a queue (like Service Bus) with appropriate concurrency config to ensure not hitting timeouts.