Closed
Fix WebAPI sample to use embedded gRPC sidecar#519
Conversation
Co-authored-by: sophiatev <38052607+sophiatev@users.noreply.github.com>
Co-authored-by: sophiatev <38052607+sophiatev@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix DurableTaskClient.ScheduleNewProcessOrderOrchestratorInstanceAsync failure
Fix WebAPI sample to use embedded gRPC sidecar
Dec 2, 2025
torosent
marked this pull request as ready for review
December 3, 2025 00:02
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a broken WebAPI sample by embedding an in-memory gRPC sidecar directly into the application, eliminating the need for an external sidecar process. The sample previously failed with "gRPC server for Durable Task gRPC worker is unavailable" because it expected an external dependency that wasn't configured.
Key Changes:
- Integrated InProcessTestHost's in-memory orchestration service to provide an embedded gRPC sidecar
- Configured Kestrel with dual endpoints: port 8080 for REST API (HTTP/1.1) and port 8081 for gRPC sidecar (HTTP/2)
- Switched from NuGet package references to project-to-project references, consistent with other samples
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| samples/WebAPI/WebAPI.csproj | Added project references for Client.Grpc, Worker.Grpc, and InProcessTestHost; commented out package references |
| samples/WebAPI/Properties/launchSettings.json | Simplified launch configuration by removing IIS Express profile, obsolete sidecar address environment variable, and unnecessary browser launch settings |
| samples/WebAPI/Program.cs | Implemented embedded gRPC sidecar with dual-port Kestrel configuration, in-memory orchestration service, and proper service registrations for TaskHubGrpcServer |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
The WebAPI sample failed with "gRPC server for Durable Task gRPC worker is unavailable" because it expected an external sidecar that wasn't running.
Changes
InProcessTestHost's in-memory orchestration service directly into the WebAPI hostKey code changes
Sample now works out of the box without external dependencies.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.