question

willh avatar image
0 Votes"
willh asked

Azure Functions Core Tools v4 unable deploy to Kubernetes

G:\>func --version
4.0.3928

G:\>dotnet --version
6.0.100


Here are the steps to reproduce the problem.


mkdir funapp2 && cd funapp2
func init --worker-runtime dotnetIsolated --docker
func new -t "HttpTrigger" -n "Login" -a "anonymous"


Modify the Dockerfile file as below:

FROM mcr.microsoft.com/dotnet/sdk:6.0 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

# To enable ssh & remote debugging on app service change the base image to the one below
# FROM mcr.microsoft.com/azure-functions/dotnet-isolated:3.0-dotnet-isolated5.0-appservice
FROM mcr.microsoft.com/azure-functions/dotnet-isolated:3.0-dotnet-isolated5.0
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
    AzureFunctionsJobHost__Logging__Console__IsEnabled=true

COPY --from=installer-env ["/home/site/wwwroot", "/home/site/wwwroot"]


Build & Push image

docker build -t willh/funapp2:latest .
docker push willh/funapp2:latest


Deploy my function app with --dry-run

func kubernetes deploy --name funapp2 --service-type NodePort --image-name willh/funapp2 --dry-run


There is only Secret been created.

data:
  AzureWebJobsStorage: VXNlRGV2ZWxvcG1lbnRTdG9yYWdlPXRydWU=
  FUNCTIONS_WORKER_RUNTIME: ZG90bmV0LWlzb2xhdGVk
apiVersion: v1
kind: Secret
metadata:
  name: funapp2
---


Where is the other YAML of the deployment?

azure-functions
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers