I am trying to publish my Azure Functions App to Kubernetes but I am getting the following error when I run this command
func kubernetes deploy --name my-function-api --namespace default --registry mycontainerregistry/docker-azure-function --csharp
Unable to find project root. Expecting to find one of host.json, local.settings.json in project root.`
This is my docker file
FROM mcr.microsoft.com/dotnet/sdk:3.1 AS installer-env
COPY . .
RUN cd /MyFunctionApp.Api && \
mkdir -p /home/site/wwwroot && \
dotnet publish *.csproj --output /home/site/wwwroot
COPY /MyFunctionApp.Api/host.json /home/site/wwwroot
COPY /MyFunctionApp.Api/local.settings.json /home/site/wwwroot
# To enable ssh & remote debugging on app service change the base image to the one below
# FROM mcr.microsoft.com/azure-functions/dotnet:2.0-appservice
FROM mcr.microsoft.com/azure-functions/dotnet:3.0
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
AzureFunctionsJobHost__Logging__Console__IsEnabled=true
COPY --from=installer-env ["/home/site/wwwroot", "/home/site/wwwroot"]
As you can see I have tried adding the following lines
COPY /MyFunctionApp.Api/host.json /home/site/wwwroot
COPY /MyFunctionApp.Api/local.settings.json /home/site/wwwroot
But that does not seem to help either, so not sure what I need to do to get this working? Any help would be appreciated.