Azure / Azure/azure-functions-host

Functions WhiteList does not block ServiceBus based trigger functions

Open
#6,157 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 12h
Merged PRs (30d)
38

Description

When I have a "functions" section in the host.json file and it does not include service bus based trigger functions, those still are being attempted to be validated. In my case, I had not included one of my functions defined as:

```
[FunctionName("SBFunc")]
public async Task SbFunc([ServiceBusTrigger("%topic%", "%sub%",
Connection = "connString")] Message receivedMessage, MessageReceiver messageReceiver, ILogger logger, ExecutionContext context
)
```

The subscription was disabled and I had not included the function SbFunc in the whitelist in Functions in host.json. At startup, I get the following error:

```
[6/4/2020 2:39:28 AM] MessageReceiver error (Action=Receive, ClientId=MessageReceiver2xxxxx/Subscriptions/yyyyyy, EntityPath=xxxxxx/Subscriptions/yyyyyy, Endpoint=zzzzzz.servicebus.windows.net)
[6/4/2020 2:39:28 AM] Microsoft.Azure.ServiceBus: Messaging entity 'zzzzzz:Topic:xxxxxxxxxx|yyyyy' is currently disabled. TrackingId:b225c1fb-b2a4-4959-a2e5-dcbe122de441_B21, SystemTracker:zzzzz, Timestamp:2020-06-04T02:39:28 TrackingId:6c14366a09d64d2ab124171a68075ccb_G5, SystemTracker:gateway7, Timestamp:2020-06-04T02:39:28.
```

**Startup info:**

```
Azure Functions Core Tools (2.7.2508 Commit hash: 4da36643c32783a832094318afcd679fa9d76455)
Function Runtime Version: 2.0.13351.0

[6/4/2020 2:39:21 AM] Host configuration file read:
[6/4/2020 2:39:21 AM] {
[6/4/2020 2:39:21 AM] "version": "2.0",
[6/4/2020 2:39:21 AM] "functionTimeout": "00:10:00",
[6/4/2020 2:39:21 AM] "functions": [
[6/4/2020 2:39:21 AM] "EntityRequested"
[6/4/2020 2:39:21 AM] ],

[6/4/2020 2:39:25 AM] Loading functions metadata
[6/4/2020 2:39:25 AM] A function whitelist has been specified, excluding all but the following functions: [EntityRequested]
[6/4/2020 2:39:25 AM] 1 functions loaded
[6/4/2020 2:39:25 AM] Generating 1 job function(s)
[6/4/2020 2:39:25 AM] Found the following functions:
[6/4/2020 2:39:25 AM] App.FunctionAppTriggers.KeepAlive
[6/4/2020 2:39:25 AM] App.FunctionAppTriggers.EchoFunction
[6/4/2020 2:39:25 AM] App.FunctionAppTriggers.RefreshCache
[6/4/2020 2:39:25 AM] App.FunctionAppTriggers.X
[6/4/2020 2:39:25 AM] App.FunctionAppTriggers.X
[6/4/2020 2:39:25 AM] App.FunctionAppTriggers.X
[6/4/2020 2:39:25 AM] App.FunctionAppTriggers.X
[6/4/2020 2:39:25 AM] App.FunctionAppTriggers.X
[6/4/2020 2:39:25 AM]
[6/4/2020 2:39:26 AM] Initializing function HTTP routes
[6/4/2020 2:39:26 AM] No HTTP routes mapped
[6/4/2020 2:39:26 AM]
[6/4/2020 2:39:26 AM] Host initialized (947ms)
[6/4/2020 2:39:28 AM] The next 5 occurrences of the 'KeepAlive' schedule (Cron: '0 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58 * * * *') will be:
```

Expected Behavior:
Functions not in white list will not even be attempted to be setup or run and errors around them shouldn't be logged.

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with a host.json functions whitelist that excludes a ServiceBusTrigger function, using the provided startup logs and SBFunc example as the starting point. Verify that the excluded function is not set up or run and that its Service Bus validation errors are absent from the logs.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
backend, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.