无法 运行 时间触发函数与 Azure 中的 CosmosDB 绑定作为 SpringBoot 应用程序

Unable to run time triggered function with CosmosDB Binding in Azure as SpringBoot App

无法打包虚拟应用程序

[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource to D:\MyFiles\akarforma\Downloads\hello-spring-function-azure-master\target\azure-functions\spring-mongtotimer
[INFO] Copied successfully.
[INFO] Step 7 of 7: Installing function extensions if needed
Extensions command requires dotnet on your path. Please make sure to install dotnet (.NET Core SDK) for your system from https://www.microsoft.com/net/download
[ERROR]
[ERROR] Failed to install the Function extensions
[INFO] ---------------------------------------------------

将其发布到 Azure 后得到

错误:

Function (spring-mongtotimer/hellodummy) Error: The binding type(s) 'cosmosDB' are not registered. Please ensure the type is correct and the binding extension is installed.





   @FunctionName("helloTimer") 
public void execute(@TimerTrigger(name = "timerInfo", schedule = "*/1 * * * * *") String timerInfo,@CosmosDBInput(name = "documents", databaseName = "db1", collectionName = "col1", connectionStringSetting = "dbStr") Optional<String>documents,ExecutionContext context){

似乎要生成包,您需要 dotnet CLI。您收到的错误是因为您生成的包不包含扩展(Cosmos DB 是一个扩展):

Extensions command requires dotnet on your path. Please make sure to install dotnet (.NET Core SDK) for your system from https://www.microsoft.com/net/download
[ERROR]
[ERROR] Failed to install the Function extensions

您使用的是最新的 Azure Functions CLI 吗?