Java 函数运行时无法启动-无法加载类型';Microsoft.Azure.ServiceBus.Management.ManagementClient';

Java 函数运行时无法启动-无法加载类型';Microsoft.Azure.ServiceBus.Management.ManagementClient';,java,azure,azure-functions,spring-cloud-function,Java,Azure,Azure Functions,Spring Cloud Function,我部署了基于Java的Azure函数的新版本。现在,在特定函数中my Azure Function resource下的Azure门户中出现以下错误: Error: The function runtime is unable to start. Microsoft.Azure.WebJobs.ServiceBus: Could not load type 'Microsoft.Azure.ServiceBus.Management.ManagementClient' from assembly

我部署了基于Java的Azure函数的新版本。现在,在特定函数中my Azure Function resource下的Azure门户中出现以下错误:

Error: The function runtime is unable to start. Microsoft.Azure.WebJobs.ServiceBus: Could not load type 'Microsoft.Azure.ServiceBus.Management.ManagementClient' from assembly 'Microsoft.Azure.ServiceBus, Version=3.0.2.0, Culture=neutral, PublicKeyToken=7e34167dcc6d6d8c'. Session Id: a9f3c42dbb524ceca2c5158df9460c97 Timestamp: 2019-12-02T18:21:46.680Z
对我来说,这听起来有点像:

有趣的是,在最后一次部署之前,除了一些Java代码的小改动外,我什么也没做。功能应用程序版本是否自动更新

我还通过kudu和日志流(应用程序日志)检查了日志

日志:

GitHub问题报告:


您对解决这些问题有什么建议吗?

似乎部署以某种方式删除了已安装的扩展。从VSCode部署TS函数后,我遇到了同样的错误。作为一种解决方法,我开始在同一个函数应用程序中创建一个新函数,使用与应用程序中其他函数相同的模板(例如Azure Service Bus主题触发器)。在我的例子中,这触发了所需扩展的新安装,错误消失了

谢谢你的提示和提示!我通过删除错误的bin目录解决了这个问题。有关详细信息,请参阅:

从解决方案中摘录自:

我已经将应用程序设置“WEBSITE\u RUN\u FROM\u PACKAGE”设置为1,因此我部署了一个没有bin目录的新版本,现在它又开始工作了。非常感谢

Azure函数(Windows、代码、Java)的详细过程:

  • mvn清洁安装或mvn清洁软件包
  • 从/target/azure\u函数中删除bin目录//
  • mvn azure功能:部署
  • PS:我正在使用maven插件来实现Azure功能

    pom.xml:

    <plugin>
            <groupId>com.microsoft.azure</groupId>
            <artifactId>azure-functions-maven-plugin</artifactId>
            <version>1.3.4</version>
    <plugin>
    
    
    com.microsoft.azure
    azure函数maven插件
    1.3.4
    
    尝试将Microsoft.Azure.ServiceBus的版本从3.0.2降级到2.7.6,以查看此错误是否可以解决。感谢您的努力!谢谢你的努力!补充:当您想在本地运行Azure功能时,同样的步骤(删除bin目录)也是必要的。希望这个创建错误bin目录的奇怪错误在不久的将来会被修复!我认为这种行为是由maven插件和azure功能核心工具触发的。
    [12/2/2019 10:44:26 PM] Starting JobHost [12/2/2019 10:44:26 PM] Starting Host (HostId=n900b368-1683948780, InstanceId=889e113f-9129-4a24-8fbf-9b560addd68e, Version=2.0.12888.0, ProcessId=2368, AppDomainId=1, InDebugMode=False, InDiagnosticMode=False, FunctionsExtensionVersion=(null)) [12/2/2019 10:44:26 PM] Loading functions metadata [12/2/2019 10:44:26 PM] 3 functions loaded [12/2/2019 10:44:26 PM] Generating 3 job function(s) [12/2/2019 10:44:26 PM] Found the following functions: [12/2/2019 10:44:26 PM] Host.Functions.lastWillCronJobProcessor [12/2/2019 10:44:26 PM] Host.Functions.serviceBusDeadLetterProcessor [12/2/2019 10:44:26 PM] Host.Functions.serviceBusProcessor [12/2/2019 10:44:26 PM] [12/2/2019 10:44:26 PM] A host error has occurred during startup operation '03187631-f70a-45f5-9c3e-008568c4c6a4'. [12/2/2019 10:44:26 PM] Microsoft.Azure.WebJobs.ServiceBus: Could not load type 'Microsoft.Azure.ServiceBus.Management.ManagementClient' from assembly 'Microsoft.Azure.ServiceBus, Version=3.0.2.0, Culture=neutral, PublicKeyToken=7e34167dcc6d6d8c'. [12/2/2019 10:44:26 PM] Stopping JobHost
    
    <plugin>
            <groupId>com.microsoft.azure</groupId>
            <artifactId>azure-functions-maven-plugin</artifactId>
            <version>1.3.4</version>
    <plugin>