After successfully updating the application (ASP.NET Core) to .NET 8 and running it locally (no docker container), I am struggling to use the container in Azure.
The container won't boot. It gets stuck at a specific point in time (see logs) with no further information. This also happens when I start the container locally.
Anyone ever experienced that? I can't seem to find a solution for it.
The Dockerfile
:
FROM mcr.microsoft.com/dotnet/aspnet:8.0-bookworm-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
COPY publish .
ENTRYPOINT ["./Application"]
The log provided by azure through scm:
2023-12-05T14:45:05.036017766Z [14:45:04 Warning] Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository
2023-12-05T14:45:05.037320672Z Storing keys in a directory '/root/ASP.NET/DataProtection-Keys' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed. For more information go to https://aka.ms/aspnet/dataprotectionwarning
2023-12-05T14:45:05.037338772Z
2023-12-05T14:45:05.315275542Z [14:45:05 Warning] Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager
2023-12-05T14:45:05.315355042Z No XML encryptor configured. Key {a052ec83-e17e-4d70-8bcf-2537c7492700} may be persisted to storage in unencrypted form.
2023-12-05T14:45:05.315362542Z
2023-12-05T14:45:05.382496649Z [14:45:05 Information] Application.Worker.CatalogChangedMessageProcessor
2023-12-05T14:45:05.382566849Z Refreshing catalog data
2023-12-05T14:45:05.382574549Z
2023-12-05T14:45:08.077826368Z [14:45:08 Warning] Microsoft.EntityFrameworkCore.Model.Validation
2023-12-05T14:45:08.079457876Z The property 'OemCustomer.ClientApplicationIds' is a collection or enumeration type with a value converter but with no value comparer. Set a value comparer to ensure the collection/enumeration elements are compared correctly.
2023-12-05T14:45:08.079477476Z
2023-12-05T14:45:14.160127997Z [14:45:14 Information] Application.Worker.CatalogChangedMessageProcessor
2023-12-05T14:45:14.160225699Z Refreshed catalog data
2023-12-05T14:45:14.160235499Z
The problem was, that now by default with .NET 8, ASP.NET Core apps in docker containers, are listening on port 8080
. So changing or setting WEBSITES_PORT
to 8080
on the app-service itself, fixed the issue.
By default an azure app-service tries to ping the docker-container using port 80.