Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ServiceBus-triggered functions: executed function is not the one which was triggered #250

Closed
myarotskaya opened this issue Apr 13, 2017 · 3 comments
Assignees

Comments

@myarotskaya
Copy link

myarotskaya commented Apr 13, 2017

I have one function app with two precompiled functions:

  1. FunctionA is triggered on messages in ServiceBus queue queue-function-a
  2. FunctionB is triggered on messages in ServiceBus queue queue-function-b

(both queues are in the same Service Bus namespace)

However the code of the second function is always executed regardless of what function is triggered.

FunctionA:

{
  "disabled": false,
  "scriptFile": "..\\bin\\AzureFunctions.ServiceBusTrigger.Bug.Receiver.dll",
  "entryPoint": "AzureFunctions.ServiceBusTrigger.Bug.Receiver.FunctionA.Runner.Run",
  "bindings": [
    {
      "name": "message",
      "type": "serviceBusTrigger",
      "direction": "in",
      "queueName": "queue-function-a",
      "connection": "ServiceBus",
      "accessRights": "manage"
    }
  ]
}
namespace AzureFunctions.ServiceBusTrigger.Bug.Receiver.FunctionA
{
    public class Runner
    {
        public static void Run(string message, TraceWriter log)
        {
            log.Info($"FunctionA processed the message: {message}");
        }
    }
}

FunctionB:

{
  "disabled": false,
  "scriptFile": "..\\bin\\AzureFunctions.ServiceBusTrigger.Bug.Receiver.dll",
  "entryPoint": "AzureFunctions.ServiceBusTrigger.Bug.Receiver.FunctionB.Runner.Run",
  "bindings": [
    {
      "name": "message",
      "type": "serviceBusTrigger",
      "direction": "in",
      "queueName": "queue-function-b",
      "connection": "ServiceBus",
      "accessRights": "manage"
    }
  ]
}
namespace AzureFunctions.ServiceBusTrigger.Bug.Receiver.FunctionB
{
    public class Runner
    {
        public static void Run(string message, TraceWriter log)
        {
            log.Info($"FunctionB processed the message: {message}");
        }
    }
}

I've created AzureFunctions.ServiceBusTrigger.Bug repository to demonstrate this unexpected behavior.

Steps to reproduce:

  1. Click Deploy to Azure
  2. FunctionApp Receiver will be created with FunctionA (with trigger on messages in queue-function-a) and FunctionB (with trigger on messages in queue-function-b)
  3. FunctionApp Sender will be created with FunctionA (manual trigger) that sends messages to the queue-function-a
  4. Run Sender

Actual result:

FunctionA is triggered with the following message in the log: "FunctionB processed the message"

Expected result:

FunctionA is triggered with the following message in the log: "FunctionA processed the message"

Note: the bug is also reproducible locally using the Azure Functions CLI.

@fabiocav fabiocav self-assigned this Apr 25, 2017
@fabiocav
Copy link
Member

Thanks for reporting this. Will investigate and update with what we find

@fabiocav
Copy link
Member

Thank you again for reporting this and for the amount of detail and the repository with the repro.

The issue has been resolved and will be deployed with the next release.

@myarotskaya
Copy link
Author

@fabiocav thank you for the quick fix, that's great that it will be included in the next release!

Temporary workaround from the Azure support team: rename Runners in FunctionA and FunctionB to RunnerA and RunnerB respectively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants