You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@justinyoo Just wondering... did the container app fail to run?
The default port of 80 is coming from the azd builder for Dockerless build -- feel free to modify it to suit your needs.
// Always default to port 80 for consistency across languages
environ = append(environ, "ORYX_RUNTIME_PORT=80")
That being said, we have #4573 to switch over to native dotnet builds, which this feedback is very much applicable -- we'll make the change as part of this.
The `dotnet` tool has native support for producing (and pushing) a
container image. This does not require a local docker daemon and in
general "does the right thing" and is the prefered way for .NET
customers to produce container
images. https://learn.microsoft.com/dotnet/core/docker/publish-as-container
gives a good overview of how this support works and we've been using
it to build and push container images for Aspire apps.
This change updates things such that we can use this support when
building a non Aspire based .NET app. If a `Dockerfile` exists, we
respect it, but otherwise instead of trying to use Oryx to produce a
container image, we will use `dotnet publish`.
In addition, we now use 8080 as the default port of a `dotnet` based
application (with no Dockerfile) as that's the default port used by
the standard ASP.NET base image.
A new recorded test was added - it builds on top of the existing
`containerapp` sample, and the test aranges to remove the `Dockerfile`
file from the template before running `up`.
FixesAzure#2632FixesAzure#4583
Output from
azd version
Run
azd version
and copy and paste the output here:azd version 1.11.0 (commit 5b92e0687e1fa96dfc8292f4b900c0c58610b6a5)
Describe the bug
Description of issue you're seeing...
When I run
azd init
for a .NET app, it automatically generates Bicep files.The auto-generated bicep file,
resources.bicep
has invalid target port number of80
.👉 .NET apps should have the target port of
8080
. (Reference)It's because the following code sets the default port number to
80
except for Java apps.azure-dev/cli/azd/internal/cmd/add/add_configure_host.go
Lines 238 to 244 in 6709811
It should also be applied to .NET apps like:
To Reproduce
Steps to reproduce the behavior...
azd init
resources.bicep
whether theingressTargetPort
value is80
or notresources.bicep
whether theenv.PORT
value is80
or notExpected behavior
A clear and concise description of what you expected to happen.
Both
ingressTargetPort
andenv.PORT
values should be8080
.Environment
Information on your environment:
* Language name and version: .NET 9
* IDE and version : VS Code (Dev Container)
The text was updated successfully, but these errors were encountered: