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.
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.