gpt4 book ai didi

azure - 通过 VSCODE 在 Azure 门户中部署多个 Azure Functions

转载 作者:行者123 更新时间:2023-12-03 03:26:07 26 4
gpt4 key购买 nike

我已经从工作区构建了一个 python azure 函数,并将其部署在 azure 门户上,该函数运行完美,没有任何问题。但是当我尝试在同一工作区上创建另一个功能时,部署会导致通知“Azure 工作区部署子菜单先前已注册”

第1步:VSCODE中的文件夹结构(我的两个单独的函数Func_HTTPtrigger_SAPlogs和Func_HTTP_trigger_SQL)

enter image description here

第 2 步:当我尝试从单个工作区部署这两个功能时,它花费了很长时间并且未在 Azure 门户中部署

enter image description here

我确实尝试使用新的 Azure 函数创建另一个工作区,但是部署后,它会覆盖之前在 Azure 函数中部署的现有函数,而无需创建新函数。

有人可以建议我们如何通过 VSCODE 部署多个功能吗?在我看来,.vscode 中可能需要调整一些内容,但不知道需要适应什么变化

  • 仅供引用扩展 json 文件如下所示:
{
"recommendations": [
"ms-azuretools.vscode-azurefunctions",
"ms-python.python"
]
}
  • 仅供引用启动 json 文件如下所示:
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Python Functions",
"type": "python",
"request": "attach",
"port": 9091,
"preLaunchTask": "func: host start"
}
]
}
  • 仅供引用设置文件如下所示:
{
"azureFunctions.deploySubpath": ".",
"azureFunctions.scmDoBuildDuringDeployment": true,
"azureFunctions.pythonVenv": ".venv",
"azureFunctions.projectLanguage": "Python",
"azureFunctions.projectRuntime": "~4",
"debug.internalConsoleOptions": "neverOpen"
}
  • 仅供引用设置文件如下所示:
{
"version": "2.0.0",
"tasks": [
{
"type": "func",
"label": "func: host start",
"command": "host start",
"problemMatcher": "$func-python-watch",
"isBackground": true,
"dependsOn": "pip install (functions)"
},
{
"label": "pip install (functions)",
"type": "shell",
"osx": {
"command": "${config:azureFunctions.pythonVenv}/bin/python -m pip install -r requirements.txt"
},
"windows": {
"command": "${config:azureFunctions.pythonVenv}\\Scripts\\python -m pip install -r requirements.txt"
},
"linux": {
"command": "${config:azureFunctions.pythonVenv}/bin/python -m pip install -r requirements.txt"
},
"problemMatcher": []
}
]
}

最佳答案

我尝试部署 2 个 Python Http 触发器函数,VS Code Azure-Functions 扩展没有任何故障,它正在成功加载和工作。

enter image description here

门户: enter image description here

The extension Azure Functions took a very long time to complete its last operation and it has prevented other extensions from running.

Azure Functions 中没有出现上述错误。

我相信,这可能是由于大型代码库阻止在 VS Code 中加载其他扩展而发生的。

检查您的 extensions 的启动激活时间在 VS Code 中并尝试优化它。
如果问题仍然存在,请在 Azure-Functions VS Code Extension 官方论坛中打开此问题 reference .

关于azure - 通过 VSCODE 在 Azure 门户中部署多个 Azure Functions,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75629631/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com