Open girguy opened 1 year ago
+1. I have the same problem, and already spent a lot of hours trying to run the "hello world" function in docker.
Try to add: AzureWebJobsFeatureFlags=EnableWorkerIndexing
Like in exemple:
FROM mcr.microsoft.com/azure-functions/node:4-nightly-node18
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
AzureFunctionsJobHost__Logging__Console__IsEnabled=true \
AzureWebJobsFeatureFlags=EnableWorkerIndexing
COPY . /home/site/wwwroot
RUN cd /home/site/wwwroot && \
npm install && \
npm run build
If you aren't using Docker, so try add "AzureWebJobsFeatureFlags": "EnableWorkerIndexing" in local.settings.json values.
Please install azure-functions-core-tools-4
by stepping inside the Docker container and run the below commands. The default logs doesn't provide any useful information apart from saying No job functions found
Step inside your docker container using this:
sudo docker run -it -u 0 -p 15000:80 demo:latest /bin/bash
After stepping inside the container, then run the below commands to install the azure-functions-core-tools-4
apt update
apt install -y curl
apt install -y gnupg
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-jammy-prod jammy main" > /etc/apt/sources.list.d/dotnetdev.list'
apt-get update
apt-get install azure-functions-core-tools-4
Then navigate to the project folder and manually run func start --verbose
to identify the missing dependencies in an easier way.
Hope it helps!
Try to add: AzureWebJobsFeatureFlags=EnableWorkerIndexing
Like in exemple:
FROM mcr.microsoft.com/azure-functions/node:4-nightly-node18 ENV AzureWebJobsScriptRoot=/home/site/wwwroot \ AzureFunctionsJobHost__Logging__Console__IsEnabled=true \ AzureWebJobsFeatureFlags=EnableWorkerIndexing COPY . /home/site/wwwroot RUN cd /home/site/wwwroot && \ npm install && \ npm run build
this worked for me
Please install
azure-functions-core-tools-4
by stepping inside the Docker container and run the below commands. The default logs doesn't provide any useful information apart from sayingNo job functions found
Step inside your docker container using this:
sudo docker run -it -u 0 -p 15000:80 demo:latest /bin/bash
After stepping inside the container, then run the below commands to install the
azure-functions-core-tools-4
apt update apt install -y curl apt install -y gnupg curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-jammy-prod jammy main" > /etc/apt/sources.list.d/dotnetdev.list' apt-get update apt-get install azure-functions-core-tools-4
Then navigate to the project folder and manually run
func start --verbose
to identify the missing dependencies in an easier way.Hope it helps!
@sudharsan2020 's suggestion did it for me. With the verbose logs I could see that the durable function's trigger was still pointing to 127.0.0.1
which doesn't resolve to azurite
's container. The connection fails and the error just says "No job functions found". How I resolved it:
local.settings.json
and set the value
"DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite:10000/devstoreaccount1;QueueEndpoint=http://azurite:10001/devstoreaccount1;TableEndpoint=http://azurite:10002/devstoreaccount1;"
ENTRYPOINT [ "func", "start", "--verbose" ]
I'm currently working on a simple Azure Function that's triggered by an HTTP request. I'm trying to run it within a Docker container, but I'm facing an issue where the function doesn't seem to be recognized. Here's the warning I receive in my logs:
warn: Host.Startup[0] No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.). info: Microsoft.Azure.WebJobs.Script.WebHost.WebScriptHostHttpRoutesManager[0] Initializing function HTTP routes No HTTP routes mapped
Azure function
Docker file
Here are the lines I used to build and run the docker container
docker build --tag ggirineza/azure_functions_image_test:v1.0.0 .
docker run -p 8080:80 -it ggirineza/azure_functions_image_test:v1.0.0
My experience with Docker is fairly limited, though I have successfully deployed similar functions using AWS Lambda, which was a more intuitive process for me. But with Azure, I really don't get it honestly..
I would really appreciate some help.