Azure / Azure/azure-functions-host
ServiceBus Output Binding: No Exception with missing ConnectionString
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 38
Description
An Azure Function with a ServiceBus output binding should throw an Exception, if the AppSetting for the ConnectionString is missing, but it doesn't.
I used an Azure EventGridTrigger as input binding.
#### Investigative information
- Timestamp: 2020-05-19T06:01:29.6751342Z
- Function App version: azurefunctions: 3.0.13353.0
- Function name(s) (as appropriate): ProcessEvent
- Invocation ID: eb60648e-fa5b-4cd0-8d34-58a531142dbe
- Region: westeurope
#### Repro steps
1. Publish an Azure Function with ServiceBus output binding:
```csharp
[FunctionName("MyFunctionName")]
[return: ServiceBus( "my-queue", Connection = "ServiceBusConnection")]
public static async Task Run([EventGridTrigger]EventGridEvent @event, ILogger logger, ExecutionContext context)
{
// some business logic
// ...
return @event;
}
```
2. Do not configure the ``ServiceBusConnection`` AppSetting.
3. Execute the Azure Funciton.
#### Expected behavior
- The Execution should fail.
- The Exception should be logged.
- The EventGrid-Subscriptions retry and dead-lettering mechanisms should be applied.
#### Actual behavior
- The excecution of the Azure Function is logged with "success".
- Nothing is send to the ServiceBus Queue
#### Known workarounds
- When the ConnectionString is configured, everything works as expected.
- When the ConnectionString is configured with an invalid value, the execution of the function fails as expected.
#### Related information
Provide any related information
* c#
* Bindings:
* Input: EventGrid
* Output: ServiceBus
Contributor guide
Assessment
This issue has not been assessed yet.