Open yutaro113 opened 3 years ago
@ahmelsayed can you please help investigate this?
@apawast , Thanks for the handling! @ahmelsayed Is there any update on this? Thank you very much!
@yutaro113
Looks like there are 2 different variations. Either AzureWebJobsScriptRoot or AzureWebsiteHomePath will be used.
In your scenario the functions can't live outside /home/site/wwwroot but it is supported when not running on AppService.
Hello Team, I am testing to deploy custom docker image (C# Linux) to Azure Functions and found that path configured in "AzureWebJobsScriptRoot" is not valid in Azure Functions.
Why is this variable configured in the default dockerfile created by this tool even if it's invalid? Should this be removed? Kindly confirm and thank you very much in advance!
Detail : 1, I have created C# Azure function image by following steps. https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-function-linux-custom-image?tabs=bash%2Cportal&pivots=programming-language-csharp
2, In the above procedure, when we use command func init, dockerfile is created with default configuration. Here we can see the environment variable "AzureWebJobsScriptRoot".
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS installer-env
COPY . /src/dotnet-function-app RUN cd /src/dotnet-function-app && \ mkdir -p /home/site/wwwroot && \ dotnet publish *.csproj --output /home/site/wwwroot
COPY --from=installer-env ["/home/site/wwwroot", "/home/site/wwwroot"]
3, But if we test with different path for publish, no functions are shown in the Portal.
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS installer-env
COPY . /src/dotnet-function-app RUN cd /src/dotnet-function-app && \ mkdir -p /test && \ dotnet publish *.csproj --output /test
4, Based on the discussion below, I could confirm AzureWebJobsScriptRoot is now not valid in Azure Functions (mentioned that application root will always be /home/site/wwwroot). https://github.com/MicrosoftDocs/azure-docs/issues/26761#issuecomment-475908193