【问题标题】:Cant sync triggers when deploying Azure Function via VS code通过 VS 代码部署 Azure Function 时无法同步触发器
【发布时间】:2023-01-26 04:44:24
【问题描述】:

我使用 Terraform 创建我的函数应用程序,然后在 VS 代码中创建他们为您生成的示例应用程序。当我尝试使用 azure 函数插件部署到 vs code 时,我得到以下输出。

6:04:05 PM test-trigger: Starting deployment...
6:04:26 PM test-trigger: Creating zip package...
6:04:26 PM test-trigger: Zip package size: 297 kB
6:04:28 PM test-trigger: Fetching changes.
6:04:44 PM test-trigger: Updating submodules.
6:04:45 PM test-trigger: Preparing deployment for commit id 'b4a19304-f'.
6:04:45 PM test-trigger: Skipping build. Project type: Run-From-Zip
6:04:46 PM test-trigger: Skipping post build. Project type: Run-From-Zip
6:04:46 PM test-trigger: Triggering recycle (preview mode disabled).
6:04:46 PM test-trigger: Updating /home/data/SitePackages/packagename.txt with deployment 20220428010427.zip
6:04:46 PM test-trigger: Deployment successful.
6:05:07 PM test-trigger: Syncing triggers...
6:05:52 PM test-trigger: Syncing triggers (Attempt 2/6)...
6:06:03 PM test-trigger: Syncing triggers (Attempt 3/6)...
6:06:24 PM test-trigger: Syncing triggers (Attempt 4/6)...
6:07:05 PM test-trigger: Syncing triggers (Attempt 5/6)...
6:08:27 PM test-trigger: Syncing triggers (Attempt 6/6)...
6:08:29 PM: Error: Encountered an error (InternalServerError) from host runtime.

如何在 vs 代码中获取有关导致此问题的原因的更多信息?

【问题讨论】:

  • 你有没有找到解决办法?尝试重新启动应用程序、创建新功能、从关联的 blob 中删除触发器配置……没有骰子。可以在活动日志中看到非常简短的错误消息,没有关于导致它的原因的线索。

标签: azure visual-studio-code azure-functions


【解决方案1】:

很难确定,部署成功了,但同步触发器是另一回事。我会推荐一些东西来帮助隔离,以确保它不仅仅是 vs 代码导致同步触发器失败。

  1. 您应该能够在门户的活动日志中看到同步触发器
  2. 管理 rest api 主要用于您在资源管理方面看到或执行的所有操作: https://learn.microsoft.com/en-us/rest/api/appservice/web-apps/sync-function-triggers 我会尝试从上述文档中的试用按钮运行此命令,然后查看它返回的内容。
  3. 最后,您应该能够在浏览器中尝试 har trace,方法是刷新函数应用程序的函数边栏选项卡下的门户,以查看在 synctriggers 命令的网络选项卡下的批处理请求中返回的内容。

    您可以尝试这些的任意组合,它应该让您了解同步触发器问题,但它可能是应用程序的网络限制、配置问题。如果没有应用程序的更多上下文,很难确定。

【讨论】:

    【解决方案2】:

    在我的例子中,我通过恢复到 python 编程模型 v1(而不是 v2 - 只能通过 API/CLI 或 VS 代码扩展可用)来解决它 尝试清除关联的存储/缓存、重新启动应用程序服务、使用付费计划创建新实例、新功能等... 当然服务器端作为活动日志跟踪错误,但没有详细信息。

    【讨论】:

      猜你喜欢
      • 2021-01-17
      • 2022-06-10
      • 2022-12-28
      • 1970-01-01
      • 1970-01-01
      • 2020-11-07
      • 2016-12-08
      • 2023-02-01
      • 1970-01-01
      相关资源
      最近更新 更多