On deployment, a function app with a new queue trigger is firing an error that looks like this:
The MyQueueTrigger function is in error: Microsoft.Azure.WebJobs.Host: Error indexing method MyQueueTrigger . Microsoft.Azure.WebJobs.Extensions.Storage.Queues: Storage account connection string AzureWebJobsAzureStorageConnectionString does not exist. Make sure that it is a defined App Setting.
In code (C#), this trigger looks like this:
[FunctionName("MyQueueTrigger")]
public async Task Run(
[QueueTrigger(
StorageConstants.MyQueue,
Connection = StorageConstants.AzureStorageConnectionString
)]
string myQueueItem,
ILogger log)
{
...
}
The constants described here are literally: "%MyQueue%" and "AzureStorageConnectionString", respectively
Post-deployment, navigating in the Azure portal to this function -> Code + Test shows the following:
{
"generatedBy": "Microsoft.NET.Sdk.Functions.Generator-4.1.1",
"configurationSource": "attributes",
"bindings": [
{
"type": "queueTrigger",
"connection": "AzureStorageConnectionString",
"queueName": "%MyQueue%",
"name": "myQueueItem"
}
],
"disabled": false,
"scriptFile": "../bin/MyNamespace.Functions.dll",
"entryPoint": "Redacted"
}
This function gets disabled on deployment/startup after the error above. The phrase "AzureWebJobsAzureStorageConnectionString" does not appear anywhere in my function app, although AzureWebJobsStorage and AzureStorageConnectionString are both required default settings. Where could I look for this concatenated string looking thing?
Adding a configuration with this Name does resolve the issue, but I don t want to commit to doing this ongoing.
Also, this queue trigger works as expected when running locally. local.settings.json looks like this:
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"AzureStorageConnectionString": "DefaultEndpointsProtocol=https;AccountName=redacted;AccountKey=redacted==;EndpointSuffix=core.windows.net",
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
"fooBlobContainer": "foo-blob-container",
"myQueue": "my-queue"
},
"AppSettings": {
"KeyVaultSecrets": {
"KeyVaultName": "https://redacted.vault.azure.net",
"DataWarehouseConnection": "DataWarehouseConnection",
"LoggingDBConnectionString": "LoggingDBConnectionString",
"ClientId": "redacted"
},
"myServiceAPI": {
"BaseURL": "redacted.azurewebsites.net/"
}
}
}