I have a .net6 application that used uses Azure Sql server. The application works fine on .Net3.1 but when ported to .Net6 the application throw a Sql server error
Microsoft.Data.SqlClient.SqlException (0x80131904): The instance of SQL Se rver you attempted to connect to requires encryption but this machine does not s upport it
The dockerfile is very generic and look like below
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["Presentation/Web.Cms/Web.Cms.csproj", "Presentation/Web.Cms/"]
RUN dotnet restore "Presentation\Web.Cms\Web.Cms.csproj"
COPY . .
WORKDIR "/src/Presentation/Web.Cms"
RUN dotnet build "Web.Cms.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "Web.Cms.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Web.Cms.dll"]
EXPOSE 80
EXPOSE 443
USER ContainerAdministrator