Reputation: 1697
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.
Upvotes: 1
Views: 645
Reputation: 14334
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.
Upvotes: 0
Reputation: 5294
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.
Upvotes: 2