HTTPS in docker in Service Fabric for asp.net core not working

I have a asp.net core application hosted in docker . The docker file looks like this

FROM  mcr.microsoft.com/dotnet/core/aspnet:3.1
LABEL cmbappname="autocomplete"
ARG source
WORKDIR /cmbapp
ADD ${source} . 
ENV APP_UTILS=C:app 
VOLUME ${APP_UTILS}
HEALTHCHECK --retries=5  --interval=100s --start-period=10s   CMD curl --fail http://localhost || exit 1 
ENTRYPOINT ["dotnet", "MyBus.AutoApi.dll"]
EXPOSE 80
EXPOSE 443

the docker image in hosted in service fabric which has a service manifest like this

<?xml version="1.0" encoding="utf-8"?>
<ServiceManifest Name="AutoApiPkg"
                 Version="1.0.0"
                 xmlns="http://schemas.microsoft.com/2011/01/fabric"
                 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <ServiceTypes>
    <!-- This is the name of your ServiceType.
         The UseImplicitHost attribute indicates this is a guest service. -->
    <StatelessServiceType ServiceTypeName="AutoApiType" UseImplicitHost="true" />
  </ServiceTypes>

  <!-- Code package is your service executable. -->
  <CodePackage Name="Code" Version="1.0.0">
    <EntryPoint>
      <!-- Follow this link for more information about deploying Windows containers to Service Fabric: https://aka.ms/sfguestcontainers -->
      <ContainerHost>
        <ImageName>autoApi</ImageName>
      </ContainerHost>
    </EntryPoint>
    <!-- Pass environment variables to your container: -->

    <EnvironmentVariables>
      <EnvironmentVariable Name="ASPNETCORE_ENVIRONMENT" Value="Debug" />

      <EnvironmentVariable Name="ASPNETCORE_URLS" Value="https://*:443/;http://*:80/;https://*:54100/;http://*:54200/"/>
    </EnvironmentVariables>


  </CodePackage>

with the container policies in the Applicaiton manifest

 <Policies>
      <ContainerHostPolicies CodePackageRef="Code"  AutoRemove="false"  UseDefaultRepositoryCredentials="false"   ContainersRetentionCount="2"  RunInteractive="true">
        <!-- See https://aka.ms/I7z0p9 for how to encrypt your repository password -->
        <PortBinding ContainerPort="443" EndpointRef="AutApiTypeEndpoint" />
        <PortBinding ContainerPort="80" EndpointRef="LocalAutApiTypeEndpoint" />
        <RepositoryCredentials  AccountName="[AzureContainerUserName]" Password="[AzureContainerPassword]" PasswordEncrypted="false"/>
        <HealthConfig   IncludeDockerHealthStatusInSystemHealthReport="true" RestartContainerOnUnhealthyDockerHealthStatus="false" />            
      </ContainerHostPolicies>
      
    </Policies>

the application runs and is functional without the enviornment variable "ASPNETCORE_URLS"

but when adding the env variable its not functional nor is it reachable.

Source: Docker Questions