skip to Main Content

I’m using VS Code v1.79.2 on MacOS v13.4.1, and am trying to create an Azure Function using the Python programming model v2 as described here. The article indicates that after selecting the folder for the new project, it will prompts for the programming language for the Function, which is where you choose Python V2 model. However, in my case, it skips right to selecting the Python environment, and creates the stubbed out code in the older V1 style. I’ve installed the Azure Functions extension (v1.11.0) and had tried installing the Azure Tools extension which seems to be a bundle of Azure-related extensions including the one for Functions, but I seem to be stuck with the V1 model.

Another difference I noted is that while the screenshot in the Microsoft docs looks like this:
Microsoft documentation, my IDE looks like this (no ‘+’ sign): What I’m seeing

Wondering if I missed something in the setup or if I don’t have the correct version of something?

Update: I got around the UI limitation by using the "func" CLI tool as described here. This allowed me to create the stubbed out code for a V2 Python Function in my VS Code project.

2

Answers


  1. Chosen as BEST ANSWER

    Could never get this working in VS Code but was able to use the "func" CLI tool, e.g.:

    func init <project name> --python -m V2
    

  2. I used VSCode V1.79.2 and Azure Tools V1.2.0.

    The + button in the official document has the same function as the lightning button in the image you used, both representing Create Function.

    You can click the lightning button and follow the document:

    enter image description here

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search