Open vijayrkn opened 5 years ago
From @mathewc on August 16, 2017 5:16
The logic in the core WebJobs SDK that we use to resolve connection strings is here: https://github.com/Azure/azure-webjobs-sdk/blob/dev/src/Microsoft.Azure.WebJobs.Host/AmbientConnectionStringProvider.cs#L34
Try adding your connection strings as actual app settings, not connection strings. If you add an app setting named "Storage" it should work. The common pattern is for connection strings is that they are prefixed with "AzureWebJobs", e.g. "AzureWebJobsStorage". However as you can see from the code I linked to, we try that prefix first, then try w/o prefix.
From @TsuyoshiUshio on August 16, 2017 5:45
I read the code. I understand why it happens. Azure Function already use "AzureWebJobsStorage" App Settings as a default. When I set the Storage, "AzureWebJobsStorage" hit first. Which means, it point the other storage account. The queue trigger works fine, however, it observes different storage account. So we need to avoid "Dashboard" and "Storage" at least.
From @TsuyoshiUshio on August 16, 2017 5:58
In addition, "ServiceBus" should be avoided. :) https://github.com/Azure/azure-webjobs-sdk/blob/663a508e8a851629c26a51e7de3af36629dfd120/src/Microsoft.Azure.WebJobs.Host/ConnectionStringNames.cs
From @peterhuene on August 16, 2017 6:19
I'm curious as to why AmbientConnectionStringProvider
checks the prefix for all requested connection strings. If these three constants are the extent of what the host uses for connection strings, why not prefix the string constants themselves and avoid potentially conflicting with user-defined connection string and setting names? I'm sure there's a good reason for it being the way it is, though.
From @peterhuene on August 16, 2017 6:28
Also, this should probably be an issue (if it is one) on the azure-webjobs-sdk
repo. It's runtime behavior and not build.
I am running into a similar situation for .Net framework 4.6.2. I am getting the following error message in spite of having the value in app.config.
From @TsuyoshiUshio on August 16, 2017 4:44
Overview
When I write a Queue Trigger with connection string name "Storage" doesn't work. However if I change the name to like "fooStorage" it works. Does it any naming rule about it?
Step to Reproduce
App Settings
Connection Strings
NOTE: YOUR_STORAGE_CONNECTION_STRING is the same.
Queue something the function is triggered
Change the connection "fooStorage" into "Storage" It doesn't work.
Expected result
It should be the same behavior. Or If "Storage" is already taken by the system, please let us know.
Actual Result
Only "Storage" doesn't work. e.g. "fooStorage" works.
Notes
When I tried it via AppSettings using the name "Storage", the behavior is the same.
Copied from original issue: Azure/azure-functions-vs-build-sdk#95