azure-functions-java-worker icon indicating copy to clipboard operation
azure-functions-java-worker copied to clipboard

Provide access to settings through context parameter

Open hannesne opened this issue 6 years ago • 2 comments

Currently it is hard to unit test a function that uses an app setting by reading it from the environment variables. It would be much easier if there was a getSetting(settingName) method on the context parameter, as the context parameter can be mocked in unit tests. At runtime the host can continue to read the value from an environment variable via the method in the context parameter, so there wouldn't be any breaking changes to the runtime.

hannesne avatar Apr 04 '19 03:04 hannesne

Created a new issue on the java-library repo: https://github.com/Azure/azure-functions-java-library/issues/89

hannesne avatar Apr 04 '19 03:04 hannesne

Reopening this issue. After digging into the code to do a pull request, I got stuck on the fact that the change is spit across both repositories. The library repo has the interface which needs to be updated. This repo has the implementation of that interface, and would need to be updated alongside it.

hannesne avatar Apr 04 '19 06:04 hannesne