Azure / Azure/azure-functions-host

Indexing exception is thrown for a disabled eventhub function with null connection string

Open
#6,885 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 10h
Merged PRs (30d)
36

Description

If you have an empty string configured for an eventhub connection string in a dotnet precompiled function app disabled via the `[disable]` attribute, the function runtime throws indexing error.

#### Investigative information

#### Repro steps
1. Create a v3 dotnet precompiled function app
2. Add an eventhub trigger function
3. Add `[disable]` attribute to the function
4. Set the corresponding connection string setting to empty in the `local.settings.json` file
5. Press F5 to run

One thing to note is that this behavior is specific for eventhub trigger functions only.

#### Expected behavior
Function runtime should not throw the indexing error.

#### Actual behavior
Function runtime throws indexing error and complains about invalid connection string

#### Known workarounds
- Set a valid connection string

OR

- Set a dummy connection string
`"Endpoint=sb://placeHolder.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=placeHolder"`

OR

- Disable indexing on the eventhub function by adding all the non-disabled functions to allowed function list by configuring functions property in the host.json. Below is the sample configuration.

```
"Functions" : [ "ActiveFuction1", "ActiveFunction2"]

Contributor guide

Open the contributing guide

Research direction

Reproduce the v3 .NET precompiled function scenario using the listed steps, focusing on an Event Hubs trigger with an empty connection string and the [disable] attribute. Trace the runtime's indexing path to determine why the disabled function still validates the connection string; done means indexing completes without an error while the function remains disabled.

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.