Azure / azure-functions-java-library

Contains annotations for writing Azure Functions in Java
MIT License
43 stars 43 forks source link

Default connection to "AzureWebJobsStorage" #43

Open jdneo opened 6 years ago

jdneo commented 6 years ago

From @mjiderhamn in https://github.com/Microsoft/azure-maven-plugins/issues/269

Plugin name and version

azure-functions-maven-plugin 1.0.0-beta-2

Expected behavior

com.microsoft.azure.functions.annotation.*Trigger.connection has a default value of empty string. Documentation (albeit for C#) says "If you leave connection empty, the Functions runtime uses the default Storage connection string in the app setting that is named AzureWebJobsStorage."

Actual behavior

If connection annotation attribute is not provided, the following error occurs when executing azure-functions:package:

[ERROR] Failed to execute goal com.microsoft.azure:azure-functions-maven-plugin:1.0.0-beta-2:package (package-functions) on project serverless-azure: Storage binding (blob/queue/table) must have non-empty connection. Invalid storage binding found on method: se.jiderhamn.serverless.azure.AzureFunction.transformBlob -> [Help 1]
jdneo commented 6 years ago

@pragnagopa Do you think we need set a default value for connection?

pragnagopa commented 6 years ago

Yes. For storage bindings, we default to AzureWebJobsStorage. I will look into this to figure out where we should fix this - in maven plugin or the java language worker.

kallolborah commented 4 years ago

I am seeing an error : Failed to execute goal com.microsoft.azure:azure-functions-maven-plugin:1.4.1:package (package-functions) on project name-azure-function: Storage binding (blob/queue/table) must have non-empty connection. Invalid storage binding found on method:

I am using @StorageAccount("AzureWebJobsStorage") and I added a connection string after the path attribute as well in @Blobinput - but I am getting the same error.

Is this an issue only on java azure functions ?