question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Func Init Python V2 Docker

See original GitHub issue

The command func init --worker-runtime python -m V2 --docker generates a Dockerfile without the env variable AzureWebJobsFeatureFlags=EnableWorkerIndexing. This prevents the function from being indexed/run inside the container.

Issue Analytics

  • State:open
  • Created 7 months ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
fernandodelacallecommented, May 25, 2023

is this still not working by default?

0reactions
flavian-anselmocommented, Jul 27, 2023

Mine worked a after I added the following lines in my docker file

FROM mcr.microsoft.com/azure-functions/python:4-python3.10

ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
    AzureFunctionsJobHost__Logging__Console__IsEnabled=true \
    AzureWebJobsFeatureFlags=EnableWorkerIndexing \  # added by me 
    AzureWebJobsStorage='Add your conection string' #added by me 

COPY requirements.txt /
RUN pip install -r /requirements.txt

COPY . /home/site/wwwroot

docker run -it --rm -p 8080:80 image_name

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure Function Python Model 2 in Docker container
I am failing to get a minimal working example running with the following setup: azure function in docker container; python as language, ...
Read more >
Python developer reference for Azure Functions
This article supports both the v1 and v2 programming model for Python in Azure Functions. The Python v1 model uses a functions.json file...
Read more >
Serverless applications with Azure Functions, Python and ...
To initialize the Azure Function project run. func init --worker-runtime python --docker. Create an HTTP triggered function.
Read more >
Docker Container on Azure Functions with Python
In this tutorial, I will show how to create a custom container with an Azure Function that performs optical character recognition (OCR) in ......
Read more >
Azure Functions Python by Microsoft
This image contains the Azure Functions runtime for Python. How to Use the Image. Please view the documentation here for information on how...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found