I created one azure function using the following command:
func init –worker-runtime python –docker
func new –name HttpExample –template “HTTP trigger”
Then I created a docker image using the following dockerfile:
FROM mcr.microsoft.com/azure-functions/python:4-python3.10
ENV AzureWebJobsScriptRoot=/home/site/wwwroot
AzureFunctionsJobHost__Logging__Console__IsEnabled=true
COPY requirements.txt /
RUN pip install -r /requirements.txt
COPY . /home/site/wwwroot
The simple azure function is working locally using func start and also working inside docker image
But after that I used another application using azure function where I imported various libraries. That application is working fine locally using func start but it is not working inside docker image.
At http://localhost:8080/api/HttpExample,I got error that no web page found and in the console I got a warning that no job functions found.
What things need to be done to make the azure function work inside docker image?
Chirantan Datta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.