Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to resolve the value for property 'CosmosDBAttribute.ConnectionStringSetting'

I have developed simple Service Bus Trigger with CosmosDB Output with Visual Studio. Connection strings of Service Bus and CosmosDB are defined in local.settings.json. Code is fully function locally. Now I have Zip Published Function(C#) to Azure.

I'm getting Error:

Microsoft.Azure.WebJobs.Host: Error indexing method 'Function1'. 
Microsoft.Azure.WebJobs.Host: Unable to resolve the value for property 
'CosmosDBAttribute.ConnectionStringSetting'. 

What should I do?

enter image description here

like image 993
Kenny_I Avatar asked Jan 01 '23 05:01

Kenny_I


1 Answers

The error tells you need to add the settings on Azure.

azure function on azure is different from azure functions on local. on local the settings is in the local.settings.json. But on azure it is in the Configuration.(Even if you deploy the local.settings.json, the function will read env settings from Congfiguration)

enter image description here

enter image description here

And dont forget to save your edit.

like image 88
Cindy Pau Avatar answered Jan 02 '23 19:01

Cindy Pau