fix: use 127.0.0.1 for gRPC server address and increase extension timeout#7346
fix: use 127.0.0.1 for gRPC server address and increase extension timeout#7346
Conversation
…eout The gRPC server binds to 127.0.0.1 (IPv4) but reported its address as "localhost", which on Windows can resolve to ::1 (IPv6). This mismatch causes the extension gRPC client to connect to the wrong address, hanging indefinitely until the timeout fires. Fix: report 127.0.0.1:PORT to match the actual bind address. Also increase the default extension startup timeout from 5s to 15s to accommodate Windows cold-start overhead (Defender scanning, process creation, gRPC handshake). Fixes #7304 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes Windows extension startup flakiness/hangs by aligning the advertised gRPC endpoint with the actual IPv4 bind address and relaxing the default extension readiness timeout.
Changes:
- Report the gRPC server address as
127.0.0.1:PORT(instead oflocalhost:PORT) to avoid IPv6localhostresolution on Windows. - Increase default extension startup timeout from 5s to 15s (still overridable via
AZD_EXT_TIMEOUT).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| cli/azd/internal/grpcserver/server.go | Advertises the gRPC server endpoint as 127.0.0.1:PORT to match the listener bind address. |
| cli/azd/cmd/middleware/extensions.go | Raises the default extension readiness timeout to 15 seconds and documents the Windows cold-start rationale. |
- Return &serverInfo instead of constructing a duplicate ServerInfo, preventing address drift between auth interceptors and token generation. - Update inline comment from "5 seconds" to "15 seconds" to match the new default. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
Add release history entries for versions 1.23.11, 1.23.12, and 1.23.13 that were merged in the last 24 hours to the Azure/azure-dev upstream. Key v1.23.13 features documented: - remoteBuild suggestion when Docker is missing (Azure#7247) - azd auth status --output json agent-friendly mode (Azure#7236) - Preflight warning abort fix (Azure#7329) - Extension IPv4/IPv6 fix + timeout increase (Azure#7346) - Container Apps and ARM error suggestions (Azure#7250) - azure.yaml SchemaStore catalog entry (Azure#7330) Also add an 'Agent Auth Validation' section to external-authentication.md documenting the new azd auth status --output json behavior for AI agents. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…eout (Azure#7346) * fix: use 127.0.0.1 for gRPC server address and increase extension timeout The gRPC server binds to 127.0.0.1 (IPv4) but reported its address as "localhost", which on Windows can resolve to ::1 (IPv6). This mismatch causes the extension gRPC client to connect to the wrong address, hanging indefinitely until the timeout fires. Fix: report 127.0.0.1:PORT to match the actual bind address. Also increase the default extension startup timeout from 5s to 15s to accommodate Windows cold-start overhead (Defender scanning, process creation, gRPC handshake). Fixes Azure#7304 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * address review: return shared serverInfo, fix stale comment - Return &serverInfo instead of constructing a duplicate ServerInfo, preventing address drift between auth interceptors and token generation. - Update inline comment from "5 seconds" to "15 seconds" to match the new default. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…eout (Azure#7346) * fix: use 127.0.0.1 for gRPC server address and increase extension timeout The gRPC server binds to 127.0.0.1 (IPv4) but reported its address as "localhost", which on Windows can resolve to ::1 (IPv6). This mismatch causes the extension gRPC client to connect to the wrong address, hanging indefinitely until the timeout fires. Fix: report 127.0.0.1:PORT to match the actual bind address. Also increase the default extension startup timeout from 5s to 15s to accommodate Windows cold-start overhead (Defender scanning, process creation, gRPC handshake). Fixes Azure#7304 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * address review: return shared serverInfo, fix stale comment - Return &serverInfo instead of constructing a duplicate ServerInfo, preventing address drift between auth interceptors and token generation. - Update inline comment from "5 seconds" to "15 seconds" to match the new default. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…eout (Azure#7346) * fix: use 127.0.0.1 for gRPC server address and increase extension timeout The gRPC server binds to 127.0.0.1 (IPv4) but reported its address as "localhost", which on Windows can resolve to ::1 (IPv6). This mismatch causes the extension gRPC client to connect to the wrong address, hanging indefinitely until the timeout fires. Fix: report 127.0.0.1:PORT to match the actual bind address. Also increase the default extension startup timeout from 5s to 15s to accommodate Windows cold-start overhead (Defender scanning, process creation, gRPC handshake). Fixes Azure#7304 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * address review: return shared serverInfo, fix stale comment - Return &serverInfo instead of constructing a duplicate ServerInfo, preventing address drift between auth interceptors and token generation. - Update inline comment from "5 seconds" to "15 seconds" to match the new default. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…eout (Azure#7346) * fix: use 127.0.0.1 for gRPC server address and increase extension timeout The gRPC server binds to 127.0.0.1 (IPv4) but reported its address as "localhost", which on Windows can resolve to ::1 (IPv6). This mismatch causes the extension gRPC client to connect to the wrong address, hanging indefinitely until the timeout fires. Fix: report 127.0.0.1:PORT to match the actual bind address. Also increase the default extension startup timeout from 5s to 15s to accommodate Windows cold-start overhead (Defender scanning, process creation, gRPC handshake). Fixes Azure#7304 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * address review: return shared serverInfo, fix stale comment - Return &serverInfo instead of constructing a duplicate ServerInfo, preventing address drift between auth interceptors and token generation. - Update inline comment from "5 seconds" to "15 seconds" to match the new default. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…eout (Azure#7346) * fix: use 127.0.0.1 for gRPC server address and increase extension timeout The gRPC server binds to 127.0.0.1 (IPv4) but reported its address as "localhost", which on Windows can resolve to ::1 (IPv6). This mismatch causes the extension gRPC client to connect to the wrong address, hanging indefinitely until the timeout fires. Fix: report 127.0.0.1:PORT to match the actual bind address. Also increase the default extension startup timeout from 5s to 15s to accommodate Windows cold-start overhead (Defender scanning, process creation, gRPC handshake). Fixes Azure#7304 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * address review: return shared serverInfo, fix stale comment - Return &serverInfo instead of constructing a duplicate ServerInfo, preventing address drift between auth interceptors and token generation. - Update inline comment from "5 seconds" to "15 seconds" to match the new default. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add CHANGELOG entry for azd 1.23.13 (2026-03-26) including features, bug fixes, and other changes from PRs Azure#7247, Azure#7236, Azure#7329, Azure#7346, Azure#7311, Azure#7250, Azure#7235, and Azure#7330. - Document AZD_EXT_TIMEOUT environment variable in environment-variables.md. This variable was introduced in PR Azure#7346 (fix: use 127.0.0.1 for gRPC server address and increase extension timeout) but was not previously documented for users. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
Fixes #7304 — Extension
azure.ai.agentsdidn't start due to timeout.Root Cause
The gRPC server binds to
127.0.0.1:0(IPv4 only) but reports its address to extensions aslocalhost:PORT. On Windows,localhostcan resolve to::1(IPv6) depending on DNS/hosts configuration. When this happens, the extension's gRPC client connects to[::1]:PORTwhere nothing is listening, causing the connection to hang indefinitely — well beyond any timeout.Changes
1. Use explicit IPv4 address (
server.go)Report
127.0.0.1:PORTinstead oflocalhost:PORTto match the actual bind address. This eliminates the IPv4/IPv6 mismatch.2. Increase default timeout (
extensions.go)Raise the default extension startup timeout from 5s to 15s. Even with the address fix, Windows cold-starts face overhead from Defender scanning, process creation, and gRPC handshake. 5s was too aggressive. The
AZD_EXT_TIMEOUTenv var still allows override.Testing
go test ./internal/grpcserver/...✅go test ./cmd/middleware/...✅