I've created an Azure function that looks like this (actually, the Microsoft template did most of the work!):
[FunctionName("Function1")]
public static void Run([ServiceBusTrigger("%queue-name%", AccessRights.Listen)]string myQueueItem, TraceWriter log)
{
log.Info($"C# ServiceBus queue trigger function processed message: {myQueueItem}");
}
My local.settings.json looks like this:
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "..",
"AzureWebJobsDashboard": "..",
"AzureWebJobsServiceBus": "..",
"queue-name": "testqueue"
}
}
I then deployed this function. This is a strange SO question, because my problem is that this worked immediately, but I didn't expect it to. The function.json is here:
{
"generatedBy": "Microsoft.NET.Sdk.Functions-1.0.0.0",
"configurationSource": "attributes",
"bindings": [
{
"type": "serviceBusTrigger",
"queueName": "%queue-name%",
"accessRights": "listen",
"name": "myQueueItem"
}
],
"disabled": false,
"scriptFile": "..\\bin\\FunctionApp8.dll",
"entryPoint": "FunctionApp8.Function1.Run"
}
Clearly, the values in local.settings.json have been copied into the function settings, but i can't see them in the portal. My question is: where are these settings now stored (queue-name and AzureWebJobsServiceBus)?
EDIT:
My Application Settings for the function:
They'll be under the "Application settings" tab of the published function app in the Azure Portal (see picture).
There's a bit of documentation here! Note that most app settings are not published automatically, and require a bit of configuration either at the publish step or after publishing.
UPDATE: If two functions are listening for an event on the same queue, only one function will be fired. This can cause seemingly buggy behavior, as a function will appear to fire/not fire when expected.
In this case, the unexpected behavior came from a competing functions and not an unexpected connection string.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With