简体   繁体   English

Azure 本地开发的功能扩展包版本问题

[英]Azure Functions Extension Bundle Version Issue for Local Development

I have a Java 11 Azure Function with a queue trigger that works as expected when deployed to Azure and properly pulls messages off of the defined service bus topic. I have a Java 11 Azure Function with a queue trigger that works as expected when deployed to Azure and properly pulls messages off of the defined service bus topic. However, running the same function locally does not work unless I rollback the version of the Azure Functions binding extensions .但是,除非我回滚Azure Functions binding extensions的版本,否则在本地运行相同的 function 不起作用。 If I don't revert the version back, the function starts locally but never pulls messages off the service bus topic.如果我不恢复版本,function 在本地启动,但永远不会从服务总线主题中提取消息。

The variable is the hosts.json file in the project that defines the extension bundle version.该变量是项目中定义扩展包版本的hosts.json文件。 For the function deployed to Azure, the following hosts.json file is used which is configured for the latest version of the extension bundle:对于部署到 Azure 的 function,使用为最新版本的扩展包配置的以下hosts.json文件:

{
  "version": "2.0",
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[3.3.0, 4.0.0)"
  }
}

The version that works locally is this:在本地工作的版本是这样的:

{
  "version": "2.0",
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[2.*, 3.0.0)"
  }
}

I have the Azure Function Core Tools v4.0.3971 (latest version) installed on my PC, as do the rest of my team members that all have this same issue.我的 PC 上安装了Azure Function Core Tools v4.0.3971(最新版本),我的团队成员的 rest 也是如此。

What am I missing in my local environment that is preventing the latest version of the extension bundle from working?我在本地环境中缺少什么会阻止最新版本的扩展包工作?

I tried to reproduce the issue by following steps:我尝试通过以下步骤重现该问题:

  1. Created Azure Functions ( Stack: Java ) in VS Code with Queue Trigger example.在带有队列触发器示例的 VS 代码中创建了 Azure 函数(堆栈:Java )。
  2. By default, version is 3.*, 4.0.0 in host.json and the messages are pulling successfully. host.json默认版本为3.*, 4.0.0 ,消息拉取成功。

在此处输入图像描述

After downgrading to version 2.*, 3.0.0 of azure functions extension bundles in host.json , the messages are pulling off successfully.降级到版本2.*, 3.0.0的 azure 功能扩展包在host.json ,消息成功拉出。

在此处输入图像描述

When running the azure functions (java), the runtime takes latest version mentioned in the host.json automatically and with which version it is running can be seen in the output terminal when in it is running.运行 azure 函数(java)时,运行时会自动采用主机中提到的最新版本host.json运行时使用的版本可以在 output 终端中查看。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM