英文:
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 'xxxxxxxx'.
Microsoft.Azure.WebJobs.Extensions.DurableTask: Unable to resolve the Azure Storage connection named 'Storage'.
Value cannot be null. (Parameter 'provider')
Failed to run function CLI command from staging folder(azure-functionsxxxxxxxxxxxx), value cannot be null. (Parameter 'provider').
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&tabs=bash
My functions code is copied from that link.
I have my local setting as :
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "<your storage account connection string>",
"FUNCTIONS_WORKER_RUNTIME": "java"
}
}
Also my gradle.build as :
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'
}
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论