Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error occurs if a Java/Python (New Model Preview) project opens in VS Code previously when creating a new Python project #3300

Closed
v-xinda opened this issue Aug 25, 2022 · 5 comments · Fixed by #3303
Assignees
Labels
AT-CTI Created by CTI team bug
Milestone

Comments

@v-xinda
Copy link

v-xinda commented Aug 25, 2022

OS: Win 10/ Mac (Inter)
Build Version: 20220819.8

Repro Steps:

  1. Create and open a Java/Python (New Model Preview) project in VS Code.
  2. F1 -> Click "Azure Functions: Create New Project..." -> Select a new folder -> Select Python language -> Select an existing Python interpreter -> Select "HTTP trigger" -> Enter the default function name -> Click "Open in current window".
  3. Check whether no error occurs.

Expect:
No error occurs.

Actual:
An error occurs.
image

More Info:

  1. Don't ask to select Authorization level when creating a python project if a Python (New Model Preview) project opens in VS Code previously.
    image
  2. This issue does not reproduce when creating projects with other languages.
  3. This issue does not reproduce when no project opens in VS Code.
@v-xinda v-xinda added the AT-CTI Created by CTI team label Aug 25, 2022
@MicroFish91 MicroFish91 added this to the 1.8.0 milestone Aug 25, 2022
@philliphoff
Copy link
Contributor

The CentralTemplateProvider is caching template providers only by language and (function) version. Now that languages can have sub-models with different sets of templates, the caching logic should also include the language model.

@ejizba
Copy link
Member

ejizba commented Aug 31, 2022

Ftr, C# already supports multiple sub-models (in-proc vs isolated) with the projectTemplateKey. You may be able to reuse projectTemplateKey for new language models as well

@philliphoff
Copy link
Contributor

The project template key isn't (currently) used in the caching of template providers and is derived from providers themselves. At least for now, we need to be able to select a template provider via (and then cache it associated with) a specific language model. That may be unwound post-preview, when the templates are pulled from the standard feeds.

@philliphoff
Copy link
Contributor

@v-xinda Can you expand on the item related to the Authorization level prompt? Are you saying that it isn't being shown but should be, or it is shown but but shouldn't be?

@v-xinda
Copy link
Author

v-xinda commented Sep 1, 2022

@philliphoff

  1. The Authorization level prompt should be shown. Because when no project opens in VS Code, ask us to select an Authorization level for Python project.
  2. Only find the function.json file related to the Authorization level prompt. More details as below:
{
  "scriptFile": "__init__.py",
  "bindings": [
    {
      "authLevel": "anonymous",
      "type": "httpTrigger",
      "direction": "in",
      "name": "req",
      "methods": [
        "get",
        "post"
      ]
    },
    {
      "type": "http",
      "direction": "out",
      "name": "$return"
    }
  ]
}

@microsoft microsoft locked and limited conversation to collaborators Oct 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
AT-CTI Created by CTI team bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants