serverless / serverless-azure-functions

Serverless Azure Functions Plugin – Add Azure Functions support to the Serverless Framework
MIT License
266 stars 162 forks source link

serviceBusQueue sample does not consume messages #485

Open psurma opened 4 years ago

psurma commented 4 years ago

This is a Bug Report

Description


- What stacktrace or error message from your provider did you see?
No errors or activity

Similar or dependent issues:

none

## Additional Data

I create a ServiceBus Queue manually and a Shared Access Policy for (Listen) in the Service Bus Namespace.  I used the Primary Connection String as the Application Configuration Value for tester_SERVICEBUS

- **_Serverless Framework Version you're using_**: 1.74.1
- **_Serverless CLI Version you're using_**: 
- **_Serverless Azure Plugin Version you're using_**: 1.0.2
- **_Operating System_**: darwin
- **_Stack Trace_**: none
- **_Provider Error messages_**:
jimmythomson commented 4 years ago

Hi Pete - did you find a solution to this problem at all? We're seeing identical behaviour with topics rather than queues. I had a chat with a Microsoft support chap last night who couldn't immediately see the problem, but what was strange was that he couldn't see the functions from my function app which were configured to trigger from the service bus. My gut feeling is that the problem isn't related to this plugin, because our packaged zip file looks fine, and it gets posted up to the zipdeploy endpoint which is supposed to guarantee the re-syncing of triggers. Pulling my hair out a little here now though. I'll post back here if I find the underlying problem.

psurma commented 4 years ago

Hi Pete - did you find a solution to this problem at all? We're seeing identical behaviour with topics rather than queues. I had a chat with a Microsoft support chap last night who couldn't immediately see the problem, but what was strange was that he couldn't see the functions from my function app which were configured to trigger from the service bus. My gut feeling is that the problem isn't related to this plugin, because our packaged zip file looks fine, and it gets posted up to the zipdeploy endpoint which is supposed to guarantee the re-syncing of triggers. Pulling my hair out a little here now though. I'll post back here if I find the underlying problem.

Hi Jimmy, unfortunately no, I did not get to the bottom of this and eventually abandoned serverless. Using the Azure plugin for Visual Studio Code worked fine for me, so I just went with that.

wbreza commented 4 years ago

@tbarlow12 - Any initial ideas here? Potential issue w/ the x-azure-settings?

In v2.0 version the x-azure-settings was deprecated but still supported for backwards compatibility. Try removing this node from your yaml config.

ianrandell-sh commented 4 years ago

hi guys - I'm having all sorts of problems with azure functions/c#/serviceBus (the latest being "Error: Binding x-azure-settingsTrigger not supported")

"Deploying the serviceBusQueue example does not work as expected." Any ideas where that sample is?? tia

jimmythomson commented 4 years ago

Just for reference, we found the source of the problem when we were experiencing this issue, and it was down to an incorrect host.json config. Here's the working contents:

{
  "version": "2.0",
  "extensions": {
    "extensionBundle": {
      "id": "Microsoft.Azure.Functions.ExtensionBundle",
      "version": "[1.*, 2.0.0)"
    }
  }
}

For some reason, we had missed the extensions property wrapping the extensionBundle property.

ianrandell-sh commented 4 years ago

thanks @jimmythomson - Ill fix that - I also have that "extensions" prop missing.

However, for my immediate "Error: Binding x-azure-settingsTrigger not supported" problem, I think Ive found the solution by debugging the transpiled js. It looks like the yaml need to be "serviceBus: true" rather than just "serviceBus" as per the docs:

So for me this does NOT work (results in "Error: Binding nameTrigger not supported"):

functions:
  myFunc:
    handler: myFunc.Run
    events:
      - serviceBus:
        name: message
        queueName: myQueueName
        connection: SERVICE_BUS_CONNECTION

but this DOES work:

functions:
  myFunc:
    handler: myFunc.Run
    events:
      - serviceBus: true # <--- NEED THIS
        name: message
        queueName: myQueueName
        connection: SERVICE_BUS_CONNECTION

I have wasted hours on this :-(