Skip to content

Commit 8e6e393

Browse files
authored
Add function app dir to worker init request (#8144)
Updated protobuf subtree to tag [v1.5.5-protofile](https://github.com/Azure/azure-functions-language-worker-protobuf/releases/tag/v1.5.5-protofile)
1 parent 94e5372 commit 8e6e393

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

src/WebJobs.Script.Grpc/Channel/GrpcWorkerChannel.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,8 @@ internal WorkerInitRequest GetWorkerInitRequest()
228228
return new WorkerInitRequest()
229229
{
230230
HostVersion = ScriptHost.Version,
231-
WorkerDirectory = _workerConfig.Description.WorkerDirectory
231+
WorkerDirectory = _workerConfig.Description.WorkerDirectory,
232+
FunctionAppDirectory = _applicationHostOptions.CurrentValue.ScriptPath
232233
};
233234
}
234235

src/WebJobs.Script.Grpc/azure-functions-language-worker-protobuf/src/proto/FunctionRpc.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ message WorkerInitRequest {
113113

114114
// Full path of worker.config.json location
115115
string worker_directory = 4;
116+
117+
// base directory for function app
118+
string function_app_directory = 5;
116119
}
117120

118121
// Worker responds with the result of initializing itself

test/WebJobs.Script.Tests/Workers/Rpc/GrpcWorkerChannelTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,10 @@ public void WorkerInitRequest_Expected()
225225
{
226226
WorkerInitRequest initRequest = _workerChannel.GetWorkerInitRequest();
227227
Assert.NotNull(initRequest.WorkerDirectory);
228+
Assert.NotNull(initRequest.FunctionAppDirectory);
228229
Assert.NotNull(initRequest.HostVersion);
229230
Assert.Equal("testDir", initRequest.WorkerDirectory);
231+
Assert.Equal(_scriptRootPath, initRequest.FunctionAppDirectory);
230232
Assert.Equal(ScriptHost.Version, initRequest.HostVersion);
231233
}
232234

0 commit comments

Comments
 (0)