Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions host/src/FunctionsNetHost/Environment/EnvironmentVariables.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,9 @@ internal static class EnvironmentVariables
/// Application pool Id for the placeholder app. Only available in Windows(when running in IIS).
/// </summary>
internal const string AppPoolId = "APP_POOL_ID";

/// <summary>
/// Environment variable for sending ServerUri to the worker.
/// </summary>
internal const string HostEndpoint = "Functions:Worker:HostEndpoint";
}
2 changes: 1 addition & 1 deletion host/src/FunctionsNetHost/Grpc/GrpcClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ internal GrpcClient(GrpcWorkerStartupOptions grpcWorkerStartupOptions, AppLoader

_outgoingMessageChannel = Channel.CreateUnbounded<StreamingMessage>(channelOptions);

_messageHandler = new IncomingGrpcMessageHandler(appLoader);
_messageHandler = new IncomingGrpcMessageHandler(appLoader, _grpcWorkerStartupOptions);
}

internal async Task InitAsync()
Expand Down
6 changes: 5 additions & 1 deletion host/src/FunctionsNetHost/Grpc/IncomingGrpcMessageHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ internal sealed class IncomingGrpcMessageHandler
{
private bool _specializationDone;
private readonly AppLoader _appLoader;
private readonly GrpcWorkerStartupOptions _grpcWorkerStartupOptions;

internal IncomingGrpcMessageHandler(AppLoader appLoader)
internal IncomingGrpcMessageHandler(AppLoader appLoader, GrpcWorkerStartupOptions grpcWorkerStartupOptions)
{
_appLoader = appLoader;
_grpcWorkerStartupOptions = grpcWorkerStartupOptions;
}

internal Task ProcessMessageAsync(StreamingMessage message)
Expand Down Expand Up @@ -78,6 +80,8 @@ private async Task Process(StreamingMessage msg)
EnvironmentUtils.SetValue(kv.Key, kv.Value);
}

EnvironmentUtils.SetValue(EnvironmentVariables.HostEndpoint, _grpcWorkerStartupOptions.ServerUri.ToString());

#pragma warning disable CS4014
Task.Run(() =>
#pragma warning restore CS4014
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<id>Microsoft.Azure.Functions.DotNetIsolatedNativeHost</id>
<title>Microsoft Azure Functions dotnet-isolated native host</title>
<tags>dotnet-isolated azure-functions azure</tags>
<version>1.0.4</version>
<version>1.0.5</version>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<projectUrl>https://github.com/Azure/azure-functions-dotnet-worker</projectUrl>
Expand Down