Skip to content

Commit 210f5c4

Browse files
author
Victoria Hall
committed
refactor all keys to be upper case
1 parent 2f20771 commit 210f5c4

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

azure_functions_worker/dispatcher.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@
5959
)
6060
from .utils.app_setting_manager import get_python_appsetting_state
6161
from .utils.common import validate_script_file_name
62-
from .utils.config_manager import read_config, is_envvar_true, get_app_setting
62+
from .utils.config_manager import (clear_config, read_config,
63+
is_envvar_true, get_app_setting)
6364
from .utils.dependency import DependencyManager
6465
from .utils.tracing import marshall_exception_trace
6566
from .utils.wrappers import disable_feature_by
@@ -814,6 +815,7 @@ async def _handle__function_environment_reload_request(self, request):
814815

815816
# Reload environment variables
816817
os.environ.clear()
818+
clear_config()
817819
env_vars = func_env_reload_request.environment_variables
818820
for var in env_vars:
819821
os.environ[var] = env_vars[var]

azure_functions_worker/utils/config_manager.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ def read_config(function_path: str):
2020
config_data = full_config_data.get("PYTHON")
2121
except FileNotFoundError:
2222
pass
23-
env_copy = os.environ
24-
# updates the config dictionary with the environment variables
23+
24+
# updates the config dictionary with the environment variables
2525
# this prioritizes set env variables over the config file
26-
config_data.update(env_copy)
26+
env_copy = os.environ
27+
for k, v in env_copy.items():
28+
config_data.update({k.upper(): v})
2729

2830

2931
def config_exists() -> bool:

0 commit comments

Comments
 (0)