Templated QueueTrigger name fails to resolve in 3.0.3.
See original GitHub issueDefining a [QueueTrigger("%InputQueue%")]
fails to resolve the InputQueue
from the App.config
appSettings
.
Repro steps
Provide the steps required to reproduce the problem
-
Add an
App.config
setting inappSettings
forInputQueue
, e.g.<add key="InputQueue" value="queue" />
-
Set the
QueueTriggerAttribute
to use the templated value, e.g.[QueueTrigger("%InputQueue%")]
Expected behavior
Prior to 3.0.*, the queue trigger would pick up the queue name from the App.config
appSettings
.
Actual behavior
Runtime exception:
Unhandled Exception: Microsoft.Azure.WebJobs.Host.Indexers.FunctionIndexingException: Error indexing method 'Functions.processQueueMessage' ---> System.InvalidOperationException: '%InputQueue%' does not resolve to a value.
at Microsoft.Azure.WebJobs.Host.NameResolverExtensions.ResolveWholeStringCore(INameResolver resolver, String resolve, Boolean throwOnFailure) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\NameResolverExtensions.cs:line 99
at Microsoft.Azure.WebJobs.Host.NameResolverExtensions.ResolveWholeString(INameResolver resolver, String resolve) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\NameResolverExtensions.cs:line 36
at Microsoft.Azure.WebJobs.Host.Queues.Triggers.QueueTriggerAttributeBindingProvider.Resolve(String queueName) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Extensions.Storage\Queues\Triggers\QueueTriggerAttributeBindingProvider.cs:line 99
at Microsoft.Azure.WebJobs.Host.Queues.Triggers.QueueTriggerAttributeBindingProvider.TryCreateAsync(TriggerBindingProviderContext context) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Extensions.Storage\Queues\Triggers\QueueTriggerAttributeBindingProvider.cs:line 61
at Microsoft.Azure.WebJobs.Host.Triggers.CompositeTriggerBindingProvider.TryCreateAsync(TriggerBindingProviderContext context) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Triggers\CompositeTriggerBindingProvider.cs:line 22
at Microsoft.Azure.WebJobs.Host.Indexers.FunctionIndexer.IndexMethodAsyncCore(MethodInfo method, IFunctionIndexCollector index, CancellationToken cancellationToken) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Indexers\FunctionIndexer.cs:line 190
at Microsoft.Azure.WebJobs.Host.Indexers.FunctionIndexer.IndexMethodAsync(MethodInfo method, IFunctionIndexCollector index, CancellationToken cancellationToken) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Indexers\FunctionIndexer.cs:line 167
--- End of inner exception stack trace ---
at Microsoft.Azure.WebJobs.Host.RecoverableException.TryRecover(ILogger logger) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Exceptions\RecoverableException.cs:line 83
at Microsoft.Azure.WebJobs.Host.Indexers.FunctionIndexer.IndexTypeAsync(Type type, IFunctionIndexCollector index, CancellationToken cancellationToken) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Indexers\FunctionIndexer.cs:line 112
at Microsoft.Azure.WebJobs.Host.Indexers.FunctionIndexProvider.CreateAsync(CancellationToken cancellationToken) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Indexers\FunctionIndexProvider.cs:line 79
at Microsoft.Azure.WebJobs.Host.Indexers.FunctionIndexProvider.GetAsync(CancellationToken cancellationToken) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Indexers\FunctionIndexProvider.cs:line 64
at Microsoft.Azure.WebJobs.Host.Executors.JobHostContextFactory.Create(CancellationToken shutdownToken, CancellationToken cancellationToken) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\JobHostContextFactory.cs:line 101
at Microsoft.Azure.WebJobs.JobHost.InitializeHostAsync(CancellationToken cancellationToken, TaskCompletionSource`1 initializationTask) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\JobHost.cs:line 359
at Microsoft.Azure.WebJobs.JobHost.StartAsyncCore(CancellationToken cancellationToken) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\JobHost.cs:line 99
at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
at WebJobExample.Program.main(String[] argv) in C:\Code\fsharp-azure-webjob\WebJobExample\Program.fs:line 19
Known workarounds
None.
Related information
- Package version: Microsoft.Azure.WebJobs.Core 3.0.3
- Links to source: https://github.com/panesofglass/fsharp-azure-webjob/tree/webjobs3.0
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Azure queue trigger error using .Net.Sdk.Functions 3.0.13: ...
I have the queue trigger set as the startup project. I continue to get these errors in spite of many change attempts to...
Read more >How to use the WebJobs SDK - Azure App Service
Automatic triggers. The QueueTrigger attribute tells the runtime to call the function whenever a queue message appears in myqueue-items .
Read more >Azure Queue storage trigger for Azure Functions
When a queue trigger function fails, Azure Functions retries the function up to five times for a given queue message, including the first...
Read more >QueueTrigger templates not showing in Function App?
Coding example for the question QueueTrigger templates not showing in ... This was an issue on the Azure Functions side, and it has...
Read more >Azure DevOps dotnet test fails with ##[error]Error
I switched my "test" execution task from .Net Core to "Visual Studio test". In VSTest task under "Test files" i specified exact project...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ranouf, the above is F#. For C#, the following should work:
Thanks @panesofglass I can confirm that I have this same issue when trying to run Azure Durable Function in Linux Container and I had to do the same workaround. Although my INameResolver implementation is the same as the DeafaultNameResolver in Azure WebJobs, but I had to include the “Values” prefix in order to retrieve the value
_configuration[$"Values:{name}"]
, of course this implies that the values are underAppSettings.Values
insideappsettings.json
.