func new does not answer

LE CARDINAL Daniel 0 Reputation points
2025-05-28T13:51:00.72+00:00

Hi, trying to follow instructions from here: https://learn.microsoft.com/en-us/azure/azure-functions/create-first-function-cli-python?tabs=linux%2Cbash%2Cazure-cli%2Cbrowser#create-a-local-function

i'm able to instanciate the project with func init --python

then when running func new --name HttpExample --template "HTTP trigger" --authlevel "

i don't get any answer at all.

Regards

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
{count} votes

1 answer

Sort by: Most helpful
  1. Gaurav Kumar 785 Reputation points Moderator
    2025-05-29T04:51:48.3866667+00:00

    Hi @LE CARDINAL Daniel ,

    This issue can happen due to a combination of incomplete commands, environment issues, and tool mismatches.

    Try the below workarounds to resolve this issue:

    Fix incomplete func new command

    The --authlevel flag is missing a value, which causes the CLI to silently hang. Update your command with this:

    func new --name HttpExample --template "HTTP trigger" --authlevel "function"
    

    Other valid values for --authlevel are: function (default, requires function key), anonymous (no auth), admin (admin key required)

    Use a clean Python virtual environment

    Be sure your Python environment is not interfering with the CLI:

    
    python3.10 -m venv .venv
    
    source .venv/bin/activate
    
    pip install -r requirements.txt
    
    

    Verify you're using the latest Azure Functions Core Tools v4:

    
    func --version
    
    

    To update:

    npm install -g azure-functions-core-tools@4 --unsafe-perm true
    

    If func start appears to hang, run it with verbose mode:

    func start --verbose
    

    This helps surface errors like missing extensions, ports in use, or misconfigured settings.

    Reset and reinitialize if needed

    If all else fails:

    rm -rf .vscode .venv __pycache__ .funcignore local.settings.json
    

    Then reinitialize the project:

    func init . --python
    func new --name HttpExample --template "HTTP trigger" --authlevel "function"
    func start
    

    In the meantime, please use this HTTP trigger function app. Unzip it and run it using func start. It is working as expected in my environment.

    Func

    func1

    Hope it helps!


    Please do not forget to click "Accept the answer” and Yes wherever the information provided helps you, this can be beneficial to other community members.

    If you have any other questions or still running into more issues, let me know in the "comments" and I would be happy to help you.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.