[Agents Extension] agent run fix for .net#7729
Conversation
Signed-off-by: trangevi <trangevi@microsoft.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes local .NET agent runs by ensuring the correct environment variable is set so ASP.NET Core binds to the intended port.
Changes:
- Detect project type earlier in
runRunto reuse for start command resolution and environment setup. - Add
ASPNETCORE_URLSwhen the detected project language isdotnet. - Add tests intended to validate
.NETvs non-.NETenv var behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
cli/azd/extensions/azure.ai.agents/internal/cmd/run.go |
Adds early project-type detection and sets ASPNETCORE_URLS for .NET runs. |
cli/azd/extensions/azure.ai.agents/internal/cmd/run_test.go |
Adds tests around expected env var composition for .NET and non-.NET projects. |
jongio
left a comment
There was a problem hiding this comment.
The fix is correct - .NET projects need ASPNETCORE_URLS to tell Kestrel which port to bind to, since it ignores the PORT env var. Moving detectProjectType earlier so it's available for both command detection and env setup is the right approach.
One concern: the tests re-implement the env-building logic inline rather than testing the actual production code path. If the ASPNETCORE_URLS block were removed from runRun(), all 4 subtests would still pass.
Nit: detectProjectType(projectDir) is now called twice per run - once at the top of runRun and again inside installDependencies. Consider passing pt to avoid the redundant file checks.
Signed-off-by: trangevi <trangevi@microsoft.com>
|
/check-enforcer override |
Fixes #7688
Adds proper env var for local .net run