diff --git a/cli/azd/internal/cmd/add/add_configure_host.go b/cli/azd/internal/cmd/add/add_configure_host.go index f2b148a3744..367584d9c57 100644 --- a/cli/azd/internal/cmd/add/add_configure_host.go +++ b/cli/azd/internal/cmd/add/add_configure_host.go @@ -238,7 +238,7 @@ func addServiceAsResource( if _, err := os.Stat(filepath.Join(svc.RelativePath, "Dockerfile")); errors.Is(err, os.ErrNotExist) { // default builder always specifies port 80 props.Port = 80 - if svc.Language == project.ServiceLanguageJava { + if svc.Language == project.ServiceLanguageJava || svc.Language.IsDotNet() { props.Port = 8080 } } diff --git a/cli/azd/internal/repository/app_init_test.go b/cli/azd/internal/repository/app_init_test.go index 37652ea84e7..6a0b7a7dac6 100644 --- a/cli/azd/internal/repository/app_init_test.go +++ b/cli/azd/internal/repository/app_init_test.go @@ -46,7 +46,7 @@ func TestInitializer_prjConfigFromDetect(t *testing.T) { Type: project.ResourceTypeHostContainerApp, Name: "dotnet", Props: project.ContainerAppProps{ - Port: 80, + Port: 8080, }, }, }, diff --git a/cli/azd/internal/repository/infra_confirm.go b/cli/azd/internal/repository/infra_confirm.go index 6cea992dea6..ee5a50f716b 100644 --- a/cli/azd/internal/repository/infra_confirm.go +++ b/cli/azd/internal/repository/infra_confirm.go @@ -212,7 +212,7 @@ func PromptPort( name string, svc appdetect.Project) (int, error) { if svc.Docker == nil || svc.Docker.Path == "" { // using default builder from azd - if svc.Language == appdetect.Java { + if svc.Language == appdetect.Java || svc.Language == appdetect.DotNet { return 8080, nil } return 80, nil diff --git a/cli/azd/internal/repository/infra_confirm_test.go b/cli/azd/internal/repository/infra_confirm_test.go index 98fcfe90ab7..7ccfdfeab25 100644 --- a/cli/azd/internal/repository/infra_confirm_test.go +++ b/cli/azd/internal/repository/infra_confirm_test.go @@ -35,7 +35,7 @@ func TestInitializer_infraSpecFromDetect(t *testing.T) { Services: []scaffold.ServiceSpec{ { Name: "dotnet", - Port: 80, + Port: 8080, Backend: &scaffold.Backend{}, }, },