该 repo包含 Azure 函数的代码。
我想在 VS Code 中打开 repo,在本地测试它,然后在 Azure 中发布代码。
我下载了 zip 文件并在 VS Code 中打开了解压后的文件夹。
VS Code 检测到该文件夹包含 Azure 函数代码,并通过提示语言(在我的情况下是 Python)和解释器进行了相应的优化调整。
我该如何测试代码?当我使用 F5 键开始调试时,出现了错误:
* Executing task: .venv\Scripts\python -m pip install -r requirements.txt
Collecting azure-functions
Using cached azure_functions-1.23.0-py3-none-any.whl (137 kB)
Collecting azure-ai-projects
Using cached azure_ai_projects-1.0.0b9-py3-none-any.whl (199 kB)
Collecting azure-identity
Using cached azure_identity-1.21.0-py3-none-any.whl (189 kB)
Collecting werkzeug~=3.0.6
Using cached werkzeug-3.0.6-py3-none-any.whl (227 kB)
Collecting MarkupSafe>=2.1.1
Using cached MarkupSafe-2.1.5-cp38-cp38-win_amd64.whl (17 kB)
Collecting isodate>=0.6.1
Using cached isodate-0.7.2-py3-none-any.whl (22 kB)
Collecting azure-core>=1.30.0
Using cached azure_core-1.33.0-py3-none-any.whl (207 kB)
Collecting typing-extensions>=4.12.2
Using cached typing_extensions-4.13.2-py3-none-any.whl (45 kB)
Collecting six>=1.11.0
Using cached six-1.17.0-py2.py3-none-any.whl (11 kB)
Collecting requests>=2.21.0
Using cached requests-2.32.3-py3-none-any.whl (64 kB)
Collecting charset-normalizer<4,>=2
Using cached charset_normalizer-3.4.1-cp38-cp38-win_amd64.whl (102 kB)
Collecting urllib3<3,>=1.21.1
Using cached urllib3-2.2.3-py3-none-any.whl (126 kB)
Collecting idna<4,>=2.5
Using cached idna-3.10-py3-none-any.whl (70 kB)
Collecting certifi>=2017.4.17
Using cached certifi-2025.1.31-py3-none-any.whl (166 kB)
Collecting msal-extensions>=1.2.0
Using cached msal_extensions-1.3.0-py3-none-any.whl (28 kB)
Collecting msal>=1.30.0
Using cached msal-1.32.0-py3-none-any.whl (114 kB)
Collecting cryptography>=2.5
Using cached cryptography-44.0.2-cp37-abi3-win_amd64.whl (3.2 MB)
Collecting cffi>=1.12
Using cached cffi-1.17.1-cp38-cp38-win_amd64.whl (181 kB)
Collecting pycparser
Using cached pycparser-2.22-py3-none-any.whl (117 kB)
Collecting PyJWT[crypto]<3,>=1.0.0
Using cached PyJWT-2.9.0-py3-none-any.whl (22 kB)
Installing collected packages: pycparser, cffi, urllib3, PyJWT, idna, cryptography, charset-normalizer, certifi, requests, typing-extensions, six, msal, MarkupSafe, werkzeug, msal-extensions, isodate, azure-core, azure-identity, azure-functions, azure-ai-projects
Successfully installed MarkupSafe-2.1.5 PyJWT-2.9.0 azure-ai-projects-1.0.0b9 azure-core-1.33.0 azure-functions-1.23.0 azure-identity-1.21.0 certifi-2025.1.31 cffi-1.17.1 charset-normalizer-3.4.1 cryptography-44.0.2 idna-3.10 isodate-0.7.2 msal-1.32.0 msal-extensions-1.3.0 pycparser-2.22 requests-2.32.3 six-1.17.0 typing-extensions-4.13.2 urllib3-2.2.3 werkzeug-3.0.6
WARNING: You are using pip version 21.1.1; however, version 25.0.1 is available.
You should consider upgrading via the 'C:\Users\manuchadha\OneDrive - Microsoft\Manu_Personal\programs\2025learnresolution\azure-ai-foundry-agent-main (1)\azure-ai-foundry-agent-main\.venv\Scripts\python.exe -m pip install --upgrade pip' command.
* Terminal will be reused by tasks, press any key to close it.
* Executing task: .venv\Scripts\activate ; func host start
Can't determine project language from files. Please use one of [--dotnet-isolated, --dotnet, --javascript, --typescript, --java, --python, --powershell, --custom]
Can't determine project language from files. Please use one of [--dotnet-isolated, --dotnet, --javascript, --typescript, --java, --python, --powershell, --custom]
Can't determine project language from files. Please use one of [--dotnet-isolated, --dotnet, --javascript, --typescript, --java, --python, --powershell, --custom]
Azure Functions Core Tools
Core Tools Version: 4.0.1 Commit hash: N/A +421f0144b42047aa289ce691dc6db4fc8b6143e6 (32-bit)
Function Runtime Version: 4.834.3.22875
Can't determine project language from files. Please use one of [--dotnet-isolated, --dotnet, --javascript, --typescript, --java, --python, --powershell, --custom]
Can't determine project language from files. Please use one of [--dotnet-isolated, --dotnet, --javascript, --typescript, --java, --python, --powershell, --custom]
Can't determine project language from files. Please use one of [--dotnet-isolated, --dotnet, --javascript, --typescript, --java, --python, --powershell, --custom]
[2025-04-19T17:43:47.687Z] File 'C:\Program Files (x86)\dotnet\dotnet.exe' is not found, 'dotnet' invocation will rely on the PATH environment variable.
[2025-04-19T17:43:48.552Z] File 'C:\Program Files (x86)\dotnet\dotnet.exe' is not found, 'dotnet' invocation will rely on the PATH environment variable.
[2025-04-19T17:43:49.293Z] The 'FUNCTIONS_WORKER_RUNTIME' setting is required. Please specify a valid value. See https://go.microsoft.com/fwlink/?linkid=2257963 for more information. The application will continue to run, but may throw an exception in a future release.
[2025-04-19T17:43:49.513Z] No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
For detailed output, run func with --verbose flag.
[2025-04-19T17:43:54.272Z] Host lock lease acquired by instance ID '0000000000000000000000001CFB97BF'.