0

Is there any way to reuse external connection objects (like connections to table storage or Cosmos) between the invocations of frequently used HTTP Azure functions? Idea is to avoid creating costly connection like cosmos/table storage on every invocations & eventually to improve the app performance.

191180rk
  • 735
  • 2
  • 12
  • 37

1 Answers1

0

You should read this article Manage connections in Azure Functions first.

As per the doc suggests, you should use Static client.

For more details, you can refer to this sample code.

Please let me know if you still have more issues.

Ivan Glasenberg
  • 29,865
  • 2
  • 44
  • 60
  • @ Ivan Yang, the above mentioned doc suggesting the approach to reuse the connection with in the SAME instance of function application service but interested to know, is there way to reuse the expensive connection object ACROSS the instance of function application services running on different VM? like Managed service instance (MSI) – 191180rk Aug 18 '20 at 07:34
  • 1
    @191180rk, I'm sorry. I'm not sure about that and I cannot find any doc about your new issue. Please raise this new issue in the [github page](https://github.com/MicrosoftDocs/azure-docs/issues?utf8=%E2%9C%93&q=%223d7daee4-fd6d-0e96-299a-90b3637e6150%22&in=body). – Ivan Glasenberg Aug 18 '20 at 07:43