Skip to content

Commit 05cc3a3

Browse files
authored
Add Azure host info (#40752)
1 parent cdd8803 commit 05cc3a3

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

docs/core/compatibility/containers/8.0/aspnet-port.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ Apps built using the older <xref:Microsoft.AspNetCore.WebHost.CreateDefaultBuild
1313

1414
## Previous behavior
1515

16-
Prior to .NET 8, you could run a container expecting port 80 to be the default port and be able to access the running app.
16+
Prior to .NET 8, you could run a container that expected port 80 to be the default port and be able to access the running app.
1717

18-
For example, running the following command allowed you to access the app locally at port 8000, which is mapped to port 80 in the container:
18+
For example, you could run the following command and then access the app locally at port 8000, which is mapped to port 80 in the container:
1919

2020
`docker run --rm -it -p 8000:80 <my-app>`
2121

@@ -66,8 +66,6 @@ $ docker kill 3cc86b4b3ea1a7303d83171c132b0645d4adf61d80131152936b01661ae82a09
6666
3cc86b4b3ea1a7303d83171c132b0645d4adf61d80131152936b01661ae82a09
6767
```
6868

69-
If you are using [Kubernetes](https://kubernetes.io/docs/tutorials/services/connect-applications-service/) or [Docker Compose](https://docs.docker.com/compose/compose-file/05-services/#ports), you will need to change the port per those schemas. See [Using .NET with Kubernetes](https://github.com/dotnet/dotnet-docker/blob/main/samples/kubernetes/README.md) for examples.
70-
7169
## Version introduced
7270

7371
.NET 8 Preview 1
@@ -84,10 +82,18 @@ The change to the port number was made because of the need to provide a good usa
8482

8583
There are two ways to respond to this breaking change:
8684

87-
- Recommended: Explicitly set the `ASPNETCORE_HTTP_PORTS`, `ASPNETCORE_HTTPS_PORTS`, and `ASPNETCORE_URLS` environment variables to the desired port. Example: `docker run --rm -it -p 9999:80 -e ASPNETCORE_HTTP_PORTS=80 <my-app>`
88-
- Update existing commands and configuration that rely on the expected default port of port 80 to reference port 8080 instead. Example: `docker run --rm -it -p 9999:8080 <my-app>`
85+
- (Recommended action) Explicitly set the `ASPNETCORE_HTTP_PORTS`, `ASPNETCORE_HTTPS_PORTS`, and `ASPNETCORE_URLS` environment variables to the desired port. Example: `docker run --rm -it -p 8000:80 -e ASPNETCORE_HTTP_PORTS=80 <my-app>`
86+
- Update existing commands and configuration that rely on the expected default port of port 80 to reference port 8080 instead. Example: `docker run --rm -it -p 8000:8080 <my-app>`
87+
88+
If your app was built using the older <xref:Microsoft.AspNetCore.WebHost.CreateDefaultBuilder?displayProperty=nameWithType> method, set `ASPNETCORE_URLS` (not `ASPNETCORE_HTTP_PORTS`). Example: `docker run --rm -it -p 8000:80 -e ASPNETCORE_URLS=http://*:80 <my-app>`.
89+
90+
If you're using [Kubernetes](https://kubernetes.io/docs/tutorials/services/connect-applications-service/) or [Docker Compose](https://docs.docker.com/compose/compose-file/05-services/#ports), you need to change the port per those schemas. For examples, see [Using .NET with Kubernetes](https://github.com/dotnet/dotnet-docker/blob/main/samples/kubernetes/README.md).
91+
92+
If you use Azure container services to host your ASP.NET Core container app, you need to update your container environment to set the desired port:
8993

90-
If your app was built using the older <xref:Microsoft.AspNetCore.WebHost.CreateDefaultBuilder?displayProperty=nameWithType> method, set `ASPNETCORE_URLS` (not `ASPNETCORE_HTTP_PORTS`). Example: `docker run --rm -it -p 9999:80 -e ASPNETCORE_URLS=http://*:80 <my-app>`
94+
- For Azure App Service, set `WEBSITES_PORT` [using the CLI](/azure/app-service/configure-custom-container?tabs=debian&pivots=container-linux#configure-port-number) or in the portal.
95+
- For Azure Container Apps, you can change the port as part of [resource creation](/azure/container-apps/get-started-existing-container-image-portal?pivots=container-apps-public-registry#application-ingress-settings).
96+
- For Azure Container Instances, you can change the port as part of [resource creation](/azure/container-instances/container-instances-quickstart-portal#create-a-container-instance).
9197

9298
## Affected APIs
9399

0 commit comments

Comments
 (0)