Repository navigation
extracting new Azure.Functions.Rpc.Server assembly in preparation for compute separation - #11916
Merged
Merged
Conversation
Brett Samblanet (brettsam)
marked this pull request as ready for review
August 10, 2026 21:19
Brett Samblanet (brettsam)
requested review from
a team,
Fabio Cavalcante (fabiocav) and
Mathew Charles (mathewc)
as code owners
August 10, 2026 21:19
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extracts the host-managed Function RPC server topology (ASP.NET Core gRPC server + worker process management + dispatchers/channel managers) from Microsoft.Azure.WebJobs.Script.Grpc into a new assembly/package Azure.Functions.Rpc.Server, leaving Microsoft.Azure.WebJobs.Script.Grpc as the process-neutral shared RPC/channel core in preparation for a future client topology.
Changes:
- Introduces
src/Functions.Rpc.Serverproject and wires it into WebHost, solution, packaging, runtime-assembly metadata, and test projects. - Splits channel/process responsibilities by making
IWorkerChannelprocess-neutral in Grpc and introducing server-side process channel contracts in Server. - Moves/centralizes shared ScriptHost RPC registrations into
RpcScriptHostCoreServiceCollectionExtensions.AddRpcScriptHostCoreServices.
Reviewed changes
Copilot reviewed 30 out of 87 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| WebJobs.Script.sln | Adds the new Server project to the solution. |
| tools/ExtensionsMetadataGenerator/test/ExtensionsMetadataGeneratorTests/ExistingRuntimeAssemblies.txt | Adds Server assembly to runtime assembly test baseline. |
| tools/ExtensionsMetadataGenerator/src/ExtensionsMetadataGenerator/runtimeAssemblies.txt | Adds Server assembly to runtime assembly list. |
| test/WebJobs.Script.Tests/WebJobs.Script.Tests.csproj | References the new Server project. |
| test/WebJobs.Script.Tests/Microsoft.Azure.WebJobs.Script.WebHost.deps.json | Updates deps baseline to include Server and moved deps. |
| test/WebJobs.Script.Tests/DependencyTests.cs | Excludes Server dll from dependency drift checks. |
| test/WebJobs.Script.Tests.Shared/WebJobs.Script.Tests.Shared.csproj | References the new Server project. |
| test/WebJobs.Script.Tests.Integration/WebJobs.Script.Tests.Integration.csproj | References the new Server project. |
| src/WebJobs.Script/runtimeassemblies.json | Adds Server to runtime assembly resolution policy list. |
| src/WebJobs.Script/runtimeassemblies-relaxed.json | Adds Server to relaxed runtime assembly list. |
| src/WebJobs.Script/Properties/AssemblyInfo.cs | Grants Server InternalsVisibleTo access. |
| src/WebJobs.Script.WebHost/WebJobs.Script.WebHost.csproj | References the new Server project. |
| src/WebJobs.Script.WebHost/DependencyInjection/DependencyValidator/DependencyValidator.cs | Updates expected type assembly for WorkerConcurrencyManager. |
| src/WebJobs.Script.Grpc/WebJobs.Script.Grpc.csproj | Moves server-only packages out; retains protobuf-generation-related packages. |
| src/WebJobs.Script.Grpc/Rpc/IFunctionRpcChannel.cs | Renames/reshapes IRpc channel contract to be process-neutral core (IFunctionRpcChannel). |
| src/WebJobs.Script.Grpc/Properties/AssemblyInfo.cs | Grants Server InternalsVisibleTo access. |
| src/WebJobs.Script.Grpc/IWorkerChannel.cs | Makes channel contract process-neutral (removes process members). |
| src/WebJobs.Script.Grpc/Hosting/RpcScriptHostCoreServiceCollectionExtensions.cs | Adds new shared DI registrations method in Grpc core. |
| src/WebJobs.Script.Grpc/Channel/WorkerChannel.cs | Adjusts WorkerChannel to implement the new process-neutral core interface. |
| src/Functions.Rpc.Server/Functions.Rpc.Server.csproj | New Server project/package definition. |
| src/Functions.Rpc.Server/Properties/AssemblyInfo.cs | Friend assemblies for tests and DynamicProxyGenAssembly2. |
| src/Functions.Rpc.Server/GrpcServiceCollectionsExtensions.cs | Adds DI extension for inbound RPC server + channels in Server. |
| src/Functions.Rpc.Server/WorkerFunctionMetadataProvider.cs | Server-side worker metadata provider implementation (moved). |
| src/Functions.Rpc.Server/WorkerConcurrencyManager.cs | Server-side dynamic concurrency manager (moved). |
| src/Functions.Rpc.Server/WorkerChannelThrottleProvider.cs | Server-side throttle provider scaffold. |
| src/Functions.Rpc.Server/RpcWebHostWorkerManager.cs | WebHost worker manager implementation for Server topology. |
| src/Functions.Rpc.Server/RpcScriptHostWorkerManager.cs | ScriptHost worker manager implementation for Server topology. |
| src/Functions.Rpc.Server/IWorkerProcessChannel.cs | New server-side contract for channels that manage a worker process. |
| src/Functions.Rpc.Server/Hosting/RpcServiceCollectionExtensions.cs | Moves ScriptHost/WebHost RPC DI registrations into Server. |
| src/Functions.Rpc.Server/Hosting/HttpScriptHostRecycleOptionsSetup.cs | Server-side hosted option setup for HTTP worker recycle behavior. |
| src/Functions.Rpc.Server/Channel/RpcWorkerChannelExtensions.cs | Adds helper to shutdown + dispose channels. |
| src/Functions.Rpc.Server/Channel/GrpcWorkerChannelFactory.cs | Server-side gRPC worker channel factory (moved). |
| src/Functions.Rpc.Server/Channel/GrpcWorkerChannel.cs | Server composite RPC worker channel implementation. |
| src/Functions.Rpc.Server/Rpc/IRpcServer.cs | Server-side IRpcServer contract. |
| src/Functions.Rpc.Server/Rpc/RpcInitializationService.cs | Server startup/shutdown orchestration for RPC server/channels. |
| src/Functions.Rpc.Server/Rpc/IWebHostRpcWorkerChannelManager.cs | Server-side WebHost channel manager contract. |
| src/Functions.Rpc.Server/Rpc/WebHostRpcWorkerChannelManager.cs | Server-side WebHost channel manager implementation. |
| src/Functions.Rpc.Server/Rpc/IJobHostRpcWorkerChannelManager.cs | Server-side JobHost channel manager contract. |
| src/Functions.Rpc.Server/Rpc/JobHostRpcWorkerChannelManager.cs | Server-side JobHost channel manager implementation. |
| src/Functions.Rpc.Server/Rpc/IRpcWorkerChannel.cs | Server composite channel contract (FunctionRpc + process channel). |
| src/Functions.Rpc.Server/Rpc/IRpcWorkerChannelFactory.cs | Server-side RPC worker channel factory contract. |
| src/Functions.Rpc.Server/Rpc/IRpcWorkerProcessFactory.cs | Server-side process factory contract for RPC workers. |
| src/Functions.Rpc.Server/Rpc/IRpcWorkerChannelDictionary.cs | Server-side concurrent dictionary wrapper for channels. |
| src/Functions.Rpc.Server/Rpc/RpcWorkerProcessFactory.cs | Creates RPC worker processes tied to the inbound server URI. |
| src/Functions.Rpc.Server/Rpc/RpcWorkerProcess.cs | RPC worker process implementation (moved). |
| src/Functions.Rpc.Server/Rpc/RpcWorkerContext.cs | RPC worker process context/args for startup. |
| src/Functions.Rpc.Server/Rpc/FunctionRegistration/RpcFunctionInvocationDispatcher.cs | Server-side RPC dispatcher implementation (moved). |
| src/Functions.Rpc.Server/Rpc/FunctionRegistration/RpcFunctionInvocationDispatcherLoadBalancer.cs | Server-side load balancing across channels. |
| src/Functions.Rpc.Server/Rpc/FunctionRegistration/IRpcFunctionInvocationDispatcherLoadBalancer.cs | Server-side load balancer contract. |
| src/Functions.Rpc.Server/FunctionInvocationDispatcherFactory.cs | Chooses HTTP vs RPC dispatcher implementation for Server topology. |
| src/Functions.Rpc.Server/Server/Startup.cs | ASP.NET Core gRPC server Startup for inbound FunctionRpc. |
| src/Functions.Rpc.Server/Server/AspNetCoreGrpcHostBuilder.cs | HostBuilder for inbound gRPC server. |
| src/Functions.Rpc.Server/Server/AspNetCoreGrpcServer.cs | Inbound gRPC server implementation. |
| src/Functions.Rpc.Server/Server/FunctionRpcService.cs | gRPC service implementation for event stream. |
| src/Functions.Rpc.Server/Server/ExtensionsCompositeEndpointDataSource.cs | Extension endpoint composition/initialization for server routing. |
| src/Functions.Rpc.Server/ProcessManagement/IWorkerProcess.cs | Worker process contract (moved). |
| src/Functions.Rpc.Server/ProcessManagement/IWorkerProcessFactory.cs | Process factory contract (moved). |
| src/Functions.Rpc.Server/ProcessManagement/IProcessRegistry.cs | Process registry contract (moved). |
| src/Functions.Rpc.Server/ProcessManagement/WorkerContext.cs | Base worker process context (moved). |
| src/Functions.Rpc.Server/ProcessManagement/WorkerProcess.cs | Base worker process implementation (moved). |
| src/Functions.Rpc.Server/ProcessManagement/WorkerProcessUtilities.cs | Worker process logging helpers (moved). |
| src/Functions.Rpc.Server/ProcessManagement/WorkerProcessExitException.cs | Worker process exit exception type (moved). |
| src/Functions.Rpc.Server/ProcessManagement/DefaultWorkerProcessFactory.cs | Default process start implementation (moved). |
| src/Functions.Rpc.Server/ProcessManagement/EmptyProcessRegistry.cs | No-op registry implementation (moved). |
| src/Functions.Rpc.Server/ProcessManagement/JobObjectRegistry.cs | Windows job object registry for child-process cleanup (moved). |
| src/Functions.Rpc.Server/Http/IHttpWorkerService.cs | HTTP worker service contract (moved). |
| src/Functions.Rpc.Server/Http/DefaultHttpWorkerService.cs | Default HTTP worker invocation/ping implementation (moved). |
| src/Functions.Rpc.Server/Http/IHttpWorkerChannel.cs | HTTP worker channel contract moved to Server and made process-capable. |
| src/Functions.Rpc.Server/Http/IHttpWorkerChannelFactory.cs | HTTP worker channel factory contract (moved). |
| src/Functions.Rpc.Server/Http/HttpWorkerChannelFactory.cs | HTTP worker channel factory implementation (moved). |
| src/Functions.Rpc.Server/Http/IHttpWorkerProcessFactory.cs | HTTP worker process factory contract (moved). |
| src/Functions.Rpc.Server/Http/HttpWorkerProcessFactory.cs | HTTP worker process factory implementation (moved). |
| src/Functions.Rpc.Server/Http/HttpWorkerProcess.cs | HTTP worker process implementation (moved). |
| src/Functions.Rpc.Server/Http/HttpWorkerContext.cs | HTTP worker process context (moved). |
| src/Functions.Rpc.Server/Http/HttpWorkerConstants.cs | HTTP worker constants (moved). |
| src/Functions.Rpc.Server/Http/HttpWorkerFunctionProvider.cs | Generates function metadata from configured HTTP routes. |
| src/Functions.Rpc.Server/Http/RpcScriptInvocationContextExtensions.cs | Converts ScriptInvocationContext to HTTP invocation payload. |
| src/Functions.Rpc.Server/Http/HttpScriptInvocationContext.cs | HTTP invocation request model (moved). |
| src/Functions.Rpc.Server/Http/HttpScriptInvocationContextExtensions.cs | Converts HTTP invocation context to HttpRequestMessage. |
| src/Functions.Rpc.Server/Http/HttpScriptInvocationResult.cs | HTTP invocation response model (moved). |
| src/Functions.Rpc.Server/Http/HttpScriptInvocationResultExtensions.cs | Converts HTTP worker results back to ScriptInvocationResult. |
| src/Functions.Rpc.Server/Http/HttpOutputBindingResponse.cs | Model for http output binding responses. |
| src/Functions.Rpc.Server/HttpFunctionInvocationDispatcher.cs | HTTP dispatcher moved into Server assembly. |
| release_notes.md | Adds a release note entry for the extraction. |
| eng/ci/templates/official/jobs/build-artifacts-windows.yml | Ensures Server project is packed in official builds. |
| Directory.Packages.props | Adds package versions for Protobuf/Grpc tooling now owned by Grpc core project. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Shyju Krishnankutty (kshyju)
approved these changes
Aug 13, 2026
Jacob Viau (jviau)
approved these changes
Aug 17, 2026
This was referenced Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
High-level this is moving our server-based Grpc functionality (including worker process management) into a new assembly called
Azure.Fucntions.Rpc.Server. The baseWebJobs.Grpcassembly continues to hold common functionality that we will use in a follow-up to introduce the "compute separation" functionality in an assembly calledAzure.Functions.Rpc.Client.Details are below, but only a few interfaces had to change to separate out some process-management that was baked into our lowest-level interfaces.
Summary
This PR extracts the existing host-managed Function RPC server and worker-process topology from
Microsoft.Azure.WebJobs.Script.Grpcinto a newAzure.Functions.Rpc.Serverassembly.The existing Grpc assembly remains the shared FunctionRpc contract, channel protocol, and ScriptHost invocation core. The implementation is intentionally dominated by repository-aware file moves; moved types retain their existing namespaces and behavior.
Assembly layout
Arrows point from consumer to dependency:
Microsoft.Azure.WebJobs.Script.Grpc— shared coreRetains:
WorkerChannelprotocol engine, capabilities, message dispatch, events, conversions, and shared-memory helpers.WorkerFunctionInvoker, descriptor providers, lifecycle services, and shutdown coordination.AddRpcScriptHostCoreServicesregistration.Azure.Functions.Rpc.Server— standard host-managed topologyOwns:
FunctionRpcService.AddScriptGrpc,AddRpcScriptHostServices, andAddCommonRpcServices.Azure.Functions.Rpc.Client— future outbound topologyA future PR will add the outbound client topology, including
Grpc.Net.Client, connection/stream management, client channels, and a client dispatcher. It will reference the shared Grpc assembly, not Server.Changes beyond relocating classes
Channel contracts are split by responsibility
IWorkerChannelremains in Grpc and is now process-neutral: it exposes onlyIdandGetWorkerStatusAsync.IRpcWorkerChannelcontract is renamed toIFunctionRpcChanneland remains in Grpc with its protocol members unchanged.IWorkerProcessChannel, which addsWorkerProcessandStartWorkerProcessAsync.IRpcWorkerChannelcomposesIFunctionRpcChannelandIWorkerProcessChannel.IHttpWorkerChannelmoves to Server and inheritsIWorkerProcessChannel.WorkerChannelnow implementsIFunctionRpcChanneland no longer requires every future channel topology to expose or launch a local process. It retainsWorkerProcessId, resource-disposal hooks, and the complete protocol/disposal implementation.GrpcWorkerChannelimplements the Server composite interface. Its process-start and disposal bodies are unchanged; only the now-unnecessaryoverridemodifiers were removed from the process members.DI registration movement is minimized
Registration methods that reference Server-owned concrete types must move to Server. To keep this mechanical:
AddScriptGrpcmoves with its existing class, namespace, method name, and call sites unchanged.RpcServiceCollectionExtensionsclass moves to Server withAddRpcScriptHostServicesandAddCommonRpcServicesunchanged.RpcScriptHostCoreServiceCollectionExtensions.AddRpcScriptHostCoreServices.Package ownership follows implementation ownership
Grpc.AspNetCore,Mono.Posix.NETStandard, andMicrosoft.Azure.WebJobs.Rpc.Core.Google.Protobuf,Grpc.Core.Api, and privateGrpc.Tools, because it owns protobuf generation.Grpc.Net.Clientis not introduced in this PR.Temporary visibility preserves a mechanical extraction
Microsoft.Azure.WebJobs.ScriptandMicrosoft.Azure.WebJobs.Script.Grpctemporarily grant Server internal access. This avoids promoting broad implementation details to public API or introducing a large host-adapter abstraction during the move. Existing test-equivalent friend access is mirrored for moved internal types.Build and runtime wiring includes the new assembly
Azure.Functions.Rpc.Server.Server -> Grpc, with noGrpc -> Serverdependency.Why
Azure.Functions.Rpc.Server?Microsoft.Azure.WebJobs.*is an existing legacy product identity. New assemblies should not introduce additional WebJobs-named components when the functionality is part of the Azure Functions runtime rather than the WebJobs programming model.Azure.Functions.Rpc.Server:Azure.Functions.Rpc.Client.Moved classes intentionally retain their existing
Microsoft.Azure.WebJobs.Script.*namespaces for now. Renaming them in the same PR would obscure the assembly-boundary review, reduce rename detection, and create unnecessary source churn. The new package, assembly, and root namespace useAzure.Functions.Rpc.Server; class namespace alignment can be handled separately if desired.Scope and behavior
This PR does not add Client, outbound transport, composition, channel handles, type forwarding, or a new Host/Worker product. The protobuf contract stays in Grpc, and standard WebHost remains the only executable topology.
No worker startup, invocation, shutdown, or disposal behavior is intended to change.
Pull request checklist
IMPORTANT: Currently, changes must be backported to the
in-procbranch to be included in Core Tools and non-Flex deployments.in-procbranch is not requiredrelease_notes.md