microsoft / vscode-azurefunctions

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

Fail to get the Python version when verifying the response from http trigger #1643

Closed v-dantch closed 4 years ago

v-dantch commented 5 years ago

OS: All Build: 20191031.33

Repro Steps:

  1. Create a new Python project.
  2. Modify the _init.py_ file like below. import logging import sys import azure.functions as func

    def main(req: func.HttpRequest) -> func.HttpResponse: logging.info('Python HTTP trigger function processed a request.') return func.HttpResponse( f"Python Version: {sys.version_info[0]}.{sys.version_info[1]}", status_code=400 )

  3. Deploy this project tp a new project created using basic creation.
  4. Query the http trigger after deploying finishes.
  5. Verify the result.

Expect: Succeed to get the correct Python version that selected in previous step.

Actual: Nothing displays. image

ejizba commented 5 years ago

@v-dantch whitespace matters in python files. I probably didn't copy/paste the code correctly into OneNote, but @nturinski has since updated the test case. Try copying/pasting again and see if it looks more like this: Screen Shot 2019-11-04 at 3 19 18 PM

v-dantch commented 5 years ago

Hi Eric, Nathan, today we verified this issue on the public Azure Functions Extension v0.20.0 and it works well lol according to your share. And I will close this bug for now.

v-ruizh commented 4 years ago

This issue also reproduces on Azure Functions extension 20200406.12, reopen it.

ejizba commented 4 years ago

@v-ruizh this one was not a bug in the extension, but a bug in the __init__.py file, so please double check that file. If you're still having problems - please file a new issue with new repro steps