Azure / azure-functions-durable-extension

Durable Task Framework extension for Azure Functions
MIT License
710 stars 263 forks source link

Cache TokenCredential #2845

Closed bachuv closed 2 weeks ago

bachuv commented 3 weeks ago

This PR caches TokenCredential to resolve a memory issue that has been reported when managed identity is enabled. With these changes, we only create the TokenCredential object once instead of every time that GetStorageAccountDetails() is called. This also means that TokenRenewalState is also created once.

These changes were verified by enabling managed identity locally using these instructions and measuring the memory in VS with and without the changes in this PR.

Pull request checklist