microsoft / vscode-azurefunctions

Azure Functions extension for VS Code
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions
MIT License
290 stars 131 forks source link

Python function name step is skipped when using v3 runtime #3883

Open samlawson1 opened 9 months ago

samlawson1 commented 9 months ago

Hi,

I am new to both VS code and Azure and am trying to get started with Azure Functions using python. I am following the quickstart guide from Microsoft linked here, but am unable to name my function when I get to step 3. There is no pop-up from VS code to name the function after selecting HTTP trigger or any other trigger templates. After finishing step 3 I get the following:

When I select another programming language I am able to name the function, but need to be able to do it in python. I am also having to use python 3.9, as when I was attempting to use python 3.10 VS code was saying that 3.10 wasn't supported, even though it says it should be here.

I have already uninstalled and reinstalled VS code and all extensions, but the error is persisting.

Does this occur consistently? Yes Repro steps:

1.Download VS Code 2.Follow steps as outlined in Quickstart: Create a function in Azure with Python using Visual Studio Code

  1. Follow all steps up until the "Name of the function you want to create" in section in step 3.
  2. Complete remaining sections of step 3.

Version: 0.11.6 OS: win32 OS Release: 10.0.19045 Product: Visual Studio Code Product Version: 1.83.1 Language: en

alexweininger commented 9 months ago

I followed the steps in the guide you linked, and I was unable to reproduce the error you ran into.

  1. What programming model did you select for Python?
  2. What version of the Azure Functions extension do you have installed?
samlawson1 commented 9 months ago

There is no programming model available for me to select (assuming you mean v1 or v2).

This is what I see after clicking create function and selecting my folder.

image

I have Azure Functions v1.13.1 installed.

alexweininger commented 9 months ago

There is no programming model available for me to select (assuming you mean v1 or v2).

This is what I see after clicking create function and selecting my folder.

image

I have Azure Functions v1.13.1 installed.

After you select Python on this step, what happens?

samlawson1 commented 9 months ago
  1. After selecting python, I select my interpreter (3.9)

image

  1. Select HTTP trigger (naming it should come next, but does not)

image

  1. Select Anonymous as the authorization level

image

  1. Select Open in current window

image

  1. Then I get the error

image

MicroFish91 commented 9 months ago

Can you please also run func --version and let me know what version you're running?

Also, you should upgrade to v4 if you haven't already, it will likely fix the issue you are running into. To upgrade, you can run:

  1. F1 > Azure Functions: Uninstall Azure Functions Core Tools
  2. F1 > Azure Functions: Install or Update Azure Functions Core Tools
samlawson1 commented 9 months ago

Thank you! That fixed it! I had v3 installed and reinstalled v4 and am all good now. There were some other steps I had to do so I'll go over them so it's documented.

  1. I did not have npm installed (via node.js) when I initially installed Azure Functions Core tools. So installed the v3 64-bit with MSI from here .
  2. I am saying that because apparently to install/update/uninstall azure functions core tools from vs code, npm or brew needs to be installed (I received an error in vs code saying so).
  3. After installing npm, I uninstalled v3 of azure functions core tools in the control panel because it was not installed with npm (I received an error in vs code when running F1 >Azure Functions: Uninstall Azure Functions Core Tools that said that was the case.
  4. I ran F1 > Azure Functions: Install or Update Azure Functions Core Tools and can name the function now.

Thank you for your help!