Azure / Azure/azure-functions-core-tools
Azure Functions Core Tools v4 unable deploy to Kubernetes
- Dominant language
- C#
- Stars
- 1.5k
- Forks
- 498
- Avg merge
- 5d 4h
- Merged PRs (30d)
- 15
Description
```txt
G:\Projects\funapp2>func --version
4.0.3928
G:\Projects\funapp2>dotnet --version
6.0.100
```
Here are the steps to reproduce the problem.
```sh
mkdir funapp2 && cd funapp2
func init --worker-runtime dotnetIsolated --docker
func new -t "HttpTrigger" -n "Login" -a "anonymous"
```
Modify the `Dockerfile` file as below:
```dockerfile
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
```sh
docker build -t willh/funapp2:latest .
docker push willh/funapp2:latest
```
Deploy my function app with `--dry-run`
```sh
func kubernetes deploy --name funapp2 --service-type NodePort --image-name willh/funapp2 --dry-run
```
There is only **Secret** been created.
```sh
data:
AzureWebJobsStorage: VXNlRGV2ZWxvcG1lbnRTdG9yYWdlPXRydWU=
FUNCTIONS_WORKER_RUNTIME: ZG90bmV0LWlzb2xhdGVk
apiVersion: v1
kind: Secret
metadata:
name: funapp2
---
```
Where is the other YAML of the deployment?
Contributor guide
Research direction
Reproduce the issue with the shown func init, Dockerfile, image build, and func kubernetes deploy --dry-run commands. Start by tracing the Kubernetes deploy command and its dry-run manifest generation; done means the dry run emits the expected deployment YAML in addition to the Secret.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp, docker, kubernetes
- Domain
- cli, cloud, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100