1

I've developed an azure function in Java that's triggered by a storage queue message. The queue name and the connection string is specified in the header of the function. I've specified connection string as 'myQueueStoreConn' and it's value is specified in the 'local.settings.json'. When I starts the function locally from command line with 'mvn azure-functions:run' it works fine and is able to work against messages in my queue. The problem is when I deploy it with 'mvn azure-functions:deploy', the deployment is successful but it doesn't works with the messages in the queue. It seems it's unable to resolve the connection string variable. Please let me know where to specify the connection string value when deploying it to azure.

1
  • Use an environment variable for myQueueStoreConn from the azure portal or you can use arm template Commented Jul 1, 2019 at 4:35

2 Answers 2

2

When function is deployed on Azure, It works only when user sets the connection string in the functions "Application Setting" configuration section.

Please check if the connection string is available in the portal or not else please add it and see if it works.

Or please check if your host.json is properly deployed or not in the portal.

Hope it helps.

Sign up to request clarification or add additional context in comments.

Comments

0

You could use the way as Mohit Verma mentioned, go to the Function Configuration and set all settings you need.

Also if you don't want to set it one by one there is another way to deploy it. Cause you must install the Azure Functions Core Tools locally, so you could use --publish-settings-only -o to publish settings and skip the content.

About the details, you could refer to this link. It will deploy all settings including your custom settings.

enter image description here

4 Comments

I'm working with Java and maven and used the command azure-functions:deploy to deploy it into azure. I'm not using the function tools.
@Reji,Imean if you are develop the local java function, you must have installed the tool. So you could just deploy the settings without content cause you have already deployed the function to portal.
I already have the tools. I just updated the connection string from the portal under app settings and its working now. One more question Can I have multiple java classes within a single app that works with different queue triggers?
@Reji,one function could only have one trigger however one function app could have many functions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.