8

I have designed a Azure Queue Trigger function in Python with the following functionalities.

  1. When a message is added to Queue named Input , the function fires
  2. It processes the message added to the Input Queue and stores the result in Output Queue

Now my problem is this is working fine when I run locally . But after deploying the function app and then if I add a message to the Input Queue , the function is not firing .

Checked everything . Here is my function.json for reference .

I havent been able to locate anything relevant to this in documentation and not sure what I'm missing .

{
  "scriptFile": "__init__.py",
  "bindings": [
    {
      "name": "msg",
      "type": "queueTrigger",
      "direction": "in",
      "queueName": "input-messages-queue",
      "connection": "AzureWebJobsStorage"
    },
    {
      "type": "queue",
      "direction": "out",
      "name": "outputmessage",
      "queueName": "output-responses-queue",
      "connection": "AzureWebJobsStorage"
    }
  ]
}

3
  • Is the setting AzureWebJobsStorage available in your Function App configuration? Are the queues available in the storage account it points to? Commented Jun 5, 2020 at 14:40
  • 1
    Hi thanks for the quick reply . I checked the Application Settings of my Function app and could see an entry called AzureWebJobsStorage and the queues in question are present inside a single storage account . Commented Jun 5, 2020 at 14:50
  • 2
    Hi , figured out my mistake . I created the queues in a different storage-account . But the function was pointing out to the storage-account where it was created within a different resource group. I created those queues in the same storage-account and voila it worked . Thanks for the guidance .. Commented Jun 5, 2020 at 15:07

5 Answers 5

9

In my case I forgot to add the settings from my "local.settings.json" file in "Configuration" of the Azure Function App in the portal. Not doing this will not add the connection string for the queue and your function will never be triggered.

Sign up to request clarification or add additional context in comments.

2 Comments

Same problem here, your answer solved it. There should be some sort of warning for that from Azure.
I got the same problem that missed connection string value from local.settings.json file & fixed. Thanks
2

figured out my mistake . I created the queues in a different storage-account . But the function was pointing out to the storage-account where it was created within a different resource group. I created those queues in the same storage-account and voila it worked

1 Comment

having the same issue, nothing happens, no logs, no errors. But my mine are in the same storage account.
1

In Visual Studio 2022, bindings to Azure Queue are stored in local.settings.json config files for local execution, for example:

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": <Azure Storage Key 1 - taken from Azure Portal>,
    "FUNCTIONS_WORKER_RUNTIME": "dotnet",
    "azurestoragetest": <Azure Storage Key 1 - taken from Azure Portal>  }
}

<Azure Storage Key 1> is Access Key for Azure Storage stored in Azure Portal.

However, when Azure Function is Published to Azure, the values for the bindings are not published (deployed) until set specifically in dependencies.

In VS select project, right click and choose Publish. On Publish page go to Service Dependencies, locate Azure Storage, click "..." to open Edit dependencies menu. From there on 2nd page there is option "Save connection string value in" - set it to Azure App Settings. By default, this setting is set to "None" - meaning Publish will not store bindings values in Azure.

The json config file in Azure for Azure Function stores only bindings, but not values of these bindings (for security reasons), so it doesn't tell us whether bindings are assigned any values or not.

Comments

0

Make sure the configuration entity is set up in the portal. I was using a custom config key for the connection name, but did not set the value for it, only locally, so the queue did not trigger the function running in the cloud.

Comments

0

I was in a similar situation and it turns out that the app_offline.htm file was accidentally deployed. I thought that it was only affecting the process of browsing the base URL of the function or disabling the HTTP functions, but it is actually stopping the queue triggers as well.

Check your root folder and if that file is there, you just need to remove it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.