Azure function - Docker image for Window VM

Atulkumar Thummar 101 Reputation points

Hello Team,

I have used Azure Functions on Kubernetes with KEDA and created docker image for Window VM and hosted on AKS windows node pool.

I have used window node pool VM is Standard_B2s AKSWindows-2019-17763.2114.210811

To run azure function on window have used below base image :

Here is the Docker file - I have created

FROM AS base

FROM AS build
COPY ["FunctionApp.csproj", "FunctionApp/"]
RUN dotnet restore "FunctionApp/FunctionApp.csproj"
COPY . .
WORKDIR "/src/FunctionApp"
RUN dotnet build "FunctionApp.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "FunctionApp.csproj" -c Release -o /app/publish

FROM base AS final
COPY --from=publish /app/publish .
#ENTRYPOINT ["dotnet", "FunctionApp.dll"]   

It create docker images successfully and pulled to AKS cluster but while reviewing Pods showing below message

"Content root path: C:\app
Now listening on: http://[::]:80
Application started. Press Ctrl+C to shut down."

IF pass - ENTRYPOINT ["dotnet", "FunctionApp.dll"]
Then pod logs shows message as

"It was not possible to find any installed .NET Core SDKs
Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:"

Can anyone has face above issue while hosting azure based function on windows based docker containerization ? Any inputs will be helpful


Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,496 questions
Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
1,932 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Pramod Valavala 20,606 Reputation points Microsoft Employee

    @Atulkumar Thummar I haven't worked with Windows containers a lot but looks like the default ENTRYPOINT for nanoserver images are cmd.exe (which loads PATH and other environment variables I suppose) and the functions containers just specify CMD (even the ASP.NET ones do the same).

    So, instead of ENTRYPOINT, try CMD.

    0 comments No comments

  2. Atulkumar Thummar 101 Reputation points

    C:\WINDOWS\system32>kubectl get pods
    jobprocessor-function-5d6b785c47-9vcxh 0/1 CrashLoopBackOff 1 18s

    C:\WINDOWS\system32>kubectl logs jobprocessor-function-5d6b785c47-9vcxh
    It was not possible to find any installed .NET Core SDKs
    Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:

    Same issue with CMD as well

    0 comments No comments

  3. Mittab 1 Reputation point

    I am facing the same issue. @Atulkumar Thummar , were you able to solve it? @Pramod Valavala could you help us here

  4. Stephen Harper 1 Reputation point

    The Azure Function Runtime running inside the container requires that an environment variable(AzureWebJobsScriptRoot) be set to the location of the Function App root. If you look at the base image for nanoserver-1809 this environment variable defaults to "C:\approot" but in the Docker file referenced in this question the FA is published to "C:\app"

    Try adding the below lines to the end of your Docker file:

    ENV AzureWebJobsScriptRoot=C:\app \

    Note that the environment variable for a windows container needs to use a windows style path.

    0 comments No comments