Azure / Azure/azure-functions-host

ServiceBusTrigger is not triggered on topic message

Open
#3,966 15 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 12h
Merged PRs (30d)
38

Description

Hello,

Having issue with ServiceBusTrigger listening to topic subscription. Function app is not started by new message in subscription. When I try to open this function in Azure portal it starts and grabs all messages from subscription. After it is started everything works fine until 10 minutes period of idle. Function used to work as expected when it was in v2 preview, but after migration it is not triggering anymore.

Function app developed in Visual Studio and deployed using VSTS release pipeline.

#### Investigative information

- Timestamp: 2019-01-17T10:15:49.837;
- Function App version: 2.0;
- Invocation ID: de69804d-17c1-40a0-a8e6-6b8fea20cad0;
- Region: East US 2

#### Repro steps

1. Create new Function app in Visual Studio;
2. Install package Microsoft.Azure.WebJobs.Extensions.ServiceBus v3.0.2;
3. Add a Function with ServiceBusTrigger pointing to service bus topic subscription;
4. Create new Function app on Azure portal;
5. Set up build and release pipelines in VSTS;
6. Run deployment;
7. Wait 10 minutes after deployment is finished;
8. Post a message to service bus topic;

#### Expected behavior
Function should be triggered by message in topic subscription.

#### Actual behavior
Function is not started until I open it on Azure portal.

#### Known workarounds

1. Trigger a function from Azure portal;
2. Function is triggered right after deployment form VSTS;
3. Probably time trigger on another function in same app will start the app, but not checked;

#### Related information

* Programming language: C#
* Connection access rights: Manage;
* Microsoft.NET.Sdk.Functions version is 1.0.24;
* Microsoft.Azure.WebJobs.Extensions.ServiceBus version is 3.0.2;
* Target Framework is netstandard2.0;
* Deployment configuration:
* Task type: Azure App Service Deploy;
* Version: 3.0;
* App type: Function app;
* Take app offline: on;
* Publish using web deploy: on;
* Remove additional files in destination: on;
* Exclude files from the App_Data folder: off;
* Rename locked files: on;

Function declaration

```csharp
[FunctionName("SendNotification")]
public static async Task Run(
[ServiceBusTrigger("%NotificationsTopicName%", "%NotificationSenderSubscription%", Connection = "NotificationSenderServiceBusListenConnection")]
string queueItem,
ILogger logger)
{
try
{
/* do work here */
}
catch (Exception exception)
{
logger.LogError(exception, $"Exception occurred while trying to send message:{Environment.NewLine}{queueItem}");
throw;
}
}
```

Contributor guide

Open the contributing guide

Research direction

No repository file or test is named. Reproduce the Visual Studio deployment with Microsoft.Azure.WebJobs.Extensions.ServiceBus v3.0.2, wait 10 minutes, and inspect the Function App and ServiceBusTrigger behavior when a topic message arrives; done means the function starts and processes the message without opening it in the portal.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.