Skip to content

Commit 93b892d

Browse files
committed
Updating function dir in metadata resp
1 parent 51758a2 commit 93b892d

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

azure_functions_worker/dispatcher.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,9 @@ async def _handle__function_load_request(self, request):
439439

440440
logger.info(
441441
'Received WorkerLoadRequest, request ID %s, function_id: %s,'
442-
'function_name: %s',
443-
self.request_id, function_id, function_name)
442+
'function_name: %s, function_app_directory: %s',
443+
self.request_id, function_id, function_name,
444+
function_app_directory)
444445

445446
programming_model = "V2"
446447
try:

azure_functions_worker/loader.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
_DEFAULT_SCRIPT_FILENAME = '__init__.py'
2828
_DEFAULT_ENTRY_POINT = 'main'
2929
_submodule_dirs = []
30+
_FUNCTION_DIRECTORY = "/home/site/wwwroot"
3031

3132

3233
def register_function_dir(path: PathLike) -> None:
@@ -150,7 +151,7 @@ def process_indexed_function(functions_registry: functions.Registry,
150151
name=function_info.name,
151152
function_id=function_info.function_id,
152153
managed_dependency_enabled=False, # only enabled for PowerShell
153-
directory=function_info.directory,
154+
directory=_FUNCTION_DIRECTORY,
154155
script_file=indexed_function.function_script_file,
155156
entry_point=function_info.name,
156157
is_proxy=False, # not supported in V4

tests/endtoend/blueprint_functions/functions_in_blueprint_only/blueprint.py

+10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
import datetime
12
import logging
3+
import time
24

35
import azure.functions as func
46

@@ -29,3 +31,11 @@ def default_template(req: func.HttpRequest) -> func.HttpResponse:
2931
" personalized response.",
3032
status_code=200
3133
)
34+
35+
36+
@bp.route(route="http_func")
37+
def http_func(req: func.HttpRequest) -> func.HttpResponse:
38+
time.sleep(1)
39+
40+
current_time = datetime.now().strftime("%H:%M:%S")
41+
return func.HttpResponse(f"{current_time}")

tests/endtoend/test_worker_process_count_functions.py

+8
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,11 @@ class TestWorkerProcessCountStein(TestWorkerProcessCount):
6868
def get_script_dir(cls):
6969
return testutils.E2E_TESTS_FOLDER / 'http_functions' /\
7070
'http_functions_stein'
71+
72+
73+
class TestWorkerProcessCountWithBlueprintStein(TestWorkerProcessCount):
74+
75+
@classmethod
76+
def get_script_dir(cls):
77+
return testutils.E2E_TESTS_FOLDER / 'blueprint_functions' /\
78+
'functions_in_blueprint_only'

0 commit comments

Comments
 (0)