Azure / Azure/azure-webpubsub

Known Issue: Azure Functions Web PubSub Trigger Throws NullReferenceException with custom connection name

Open
#884 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
147
Forks
96
Avg merge
19h 28m
Merged PRs (30d)
87

Description

### Describe the bug
Azure Web PubSub extension version 1.10.0 introduces a regression. When using Azure Functions with Azure Web PubSub Trigger or Web PubSub Context Input Binding, a `NullReferenceException` may occur during request validation if the Function App is configured with a custom Web PubSub connection setting name. This can cause Web PubSub events (such as connect or system events) to fail.

This problematic version is also included in Function Extension Bundles 4.33.x through 4.34.x

### Impact

Azure Functions apps fail to handle Web PubSub events.

### Recommended Mitigations

The mitigation depends on how you reference the Azure Web PubSub Functions extension in your Function App.

#### If You Reference the Web PubSub Functions Extension Directly (No Extension Bundle)
If your Function App explicitly references the Azure Web PubSub Functions extension NuGet package (instead of using Function Extension Bundles):

Upgrade or the extension to version 1.10.1.

Version 1.10.1 includes a fix for this issue and fully resolves the runtime exception.

#### If You Use Function Extension Bundles
If your Function App uses Function Extension Bundles:

Until the fix is available through a newer Function Extension Bundle release, we recommend to pin the Function Extension Bundle to an Earlier Version.
In host.json:
```
{
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[4.32.0, 4.32.0]"
}
}

```

This pins the runtime to a bundle that uses Azure Web PubSub extension version 1.9.0, which does not have this issue.

### Fix Status
A fix has been implemented in the Azure Web PubSub extension and will be available through a future Function Extension Bundle release. Once that version is available and applied, the mitigations above will no longer be required.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Azure Web PubSub extension version 1.10.0 behavior and the host.json extensionBundle configuration shown in the report. Verify whether the implemented fix is available through a newer bundle; done means custom connection names no longer cause the NullReferenceException and the documented mitigations are no longer needed.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.