Add function app dir to worker init request
Updated protobuf subtree to tag [v1.5.5-protofile](https://github.com/Azure/azure-functions-language-worker-protobuf/releases/tag/v1.5.5-protofile)
MODIFY
src/WebJobs.Script.Grpc/Channel/GrpcWorkerChannel.cs
src/WebJobs.Script.Grpc/Channel/GrpcWorkerChannel.cs
@@ -228,7 +228,8 @@ internal WorkerInitRequest GetWorkerInitRequest()
return new WorkerInitRequest()
{
HostVersion = ScriptHost.Version,
- WorkerDirectory = _workerConfig.Description.WorkerDirectory
+ WorkerDirectory = _workerConfig.Description.WorkerDirectory,
+ FunctionAppDirectory = _applicationHostOptions.CurrentValue.ScriptPath
};
}

MODIFY
src/WebJobs.Script.Grpc/azure-functions-language-worker-protobuf/src/proto/FunctionRpc.proto
src/WebJobs.Script.Grpc/azure-functions-language-worker-protobuf/src/proto/FunctionRpc.proto
@@ -113,6 +113,9 @@ message WorkerInitRequest {
// Full path of worker.config.json location
string worker_directory = 4;
+
+ // base directory for function app
+ string function_app_directory = 5;
}
// Worker responds with the result of initializing itself

MODIFY
test/WebJobs.Script.Tests/Workers/Rpc/GrpcWorkerChannelTests.cs
test/WebJobs.Script.Tests/Workers/Rpc/GrpcWorkerChannelTests.cs
@@ -225,8 +225,10 @@ public void WorkerInitRequest_Expected()
{
WorkerInitRequest initRequest = _workerChannel.GetWorkerInitRequest();
Assert.NotNull(initRequest.WorkerDirectory);
+ Assert.NotNull(initRequest.FunctionAppDirectory);
Assert.NotNull(initRequest.HostVersion);
Assert.Equal("testDir", initRequest.WorkerDirectory);
+ Assert.Equal(_scriptRootPath, initRequest.FunctionAppDirectory);
Assert.Equal(ScriptHost.Version, initRequest.HostVersion);
}

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)