Azure持久函数 – 参数提供程序错误

huangapple go评论59阅读模式
英文:

Azure Durable Function - Parameter provider error

问题

在尝试构建Azure Durable Function时,我在尝试构建我的第一个程序时遇到错误。

启动操作期间发生主机错误 'xxxxxxxx'。
Microsoft.Azure.WebJobs.Extensions.DurableTask: 无法解析名为 'Storage' 的Azure存储连接。
值不能为空。(参数 'provider')
无法从分级文件夹(azure-functionsxxxxxxxxxxxx)运行函数CLI命令,值不能为空。(参数 'provider')。

我尝试按照这个教程进行操作,但没有成功:https://learn.microsoft.com/en-us/azure/azure-functions/durable/quickstart-java?pivots=create-option-manual-setup&tabs=bash

我的函数代码是从该链接复制的。

我的本地设置如下:

{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "<你的存储账户连接字符串>",
"FUNCTIONS_WORKER_RUNTIME": "java"
}
}

此外,我的gradle.build文件如下:

plugins {
id "com.microsoft.azure.azurefunctions" version "1.12.0"
}
apply plugin: "java"

group 'com.phoenix.api'
version '1.0.0-SNAPSHOT'

dependencies {
implementation 'com.microsoft.azure.functions:azure-functions-java-library:3.0.0'
implementation 'com.microsoft:durabletask-azure-functions:1.1.0'
testImplementation 'org.mockito:mockito-core:2.23.4'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.4.2'
implementation 'org.json:json:20230227'
}

我不知道导致这个错误的缺失部分,因为我无法在网上找到相关信息。

英文:

While trying to build Azure Durable Function, i am getting error while trying to build my first program.

A host error has occurred during startup operation &#39;xxxxxxxx&#39;.
Microsoft.Azure.WebJobs.Extensions.DurableTask: Unable to resolve the Azure Storage connection named &#39;Storage&#39;.
Value cannot be null. (Parameter &#39;provider&#39;)
Failed to run function CLI command from staging folder(azure-functionsxxxxxxxxxxxx), value cannot be null. (Parameter &#39;provider&#39;).

I am tryint to follow this tutorial, but to no vail : https://learn.microsoft.com/en-us/azure/azure-functions/durable/quickstart-java?pivots=create-option-manual-setup&amp;tabs=bash

My functions code is copied from that link.

I have my local setting as :

{
  &quot;IsEncrypted&quot;: false,
  &quot;Values&quot;: {
    &quot;AzureWebJobsStorage&quot;: &quot;&lt;your storage account connection string&gt;&quot;,
    &quot;FUNCTIONS_WORKER_RUNTIME&quot;: &quot;java&quot;
  }
}

Also my gradle.build as :

plugins {
    id &quot;com.microsoft.azure.azurefunctions&quot; version &quot;1.12.0&quot;
}
apply plugin: &quot;java&quot;

group &#39;com.phoenix.api&#39;
version &#39;1.0.0-SNAPSHOT&#39;

dependencies {
    implementation &#39;com.microsoft.azure.functions:azure-functions-java-library:3.0.0&#39;
    implementation &#39;com.microsoft:durabletask-azure-functions:1.1.0&#39;
    testImplementation &#39;org.mockito:mockito-core:2.23.4&#39;
    testImplementation &#39;org.junit.jupiter:junit-jupiter-api:5.4.2&#39;
    implementation &#39;org.json:json:20230227&#39;
}

I dont know what is mising to create this error as I was unable to find it online.

答案1

得分: 0

问题出在运行配置上,因为InteliJ没有使用我的local.setting.json文件,我需要手动指定与存储的连接字符串。

在第一次构建后,IntelliJ会保存您的配置,但不会在local.settings.json文件中的更改后更新。

英文:

So, I figure it out.

Problem was in run configuration as InteliJ didnt use my local.setting.json file and I needed to specify connection string to storage by hand.

IntelliJ will save your config after fisrt build and wont update after changes in local.settings.json file.

huangapple
  • 本文由 发表于 2023年5月29日 20:18:57
  • 转载请务必保留本文链接:https://go.coder-hub.com/76357319.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定