There seems to be an issue in the WebPubSub extension (Microsoft.Azure.WebJobs.Extensions.WebPubSub) that overrides defaults for object serialization globally. In applications in which this extension is loaded by the host, this affects this line in the DF extension, serializing OOProc SDKs' payload in an unexpected format (enums are serialized as strings instead of numbers, and properties are camelcased when they shouldn't), causing errors for OOProc DF applications.
This error is particularly exacerbated for upcoming programming models for Python (V2) and Node (V4), which require the EnableWorkerIndexing feature flag to be set. Before https://github.com/Azure/azure-functions-host/issues/8870, setting this flag meant that all extensions in an extension bundle are loaded, even if they aren't used by the application. This means that any app using extension bundles (current or upcoming programming model) that sets the EnableWorkerIndexing flag, would experience this issue, unless they run a host version which includes the fix for https://github.com/Azure/azure-functions-host/issues/8870 (not yet rolled out in Azure).
Who's Affected
This issue affects app where both the WebPubSub extension and the DF extension are loaded. This can be:
PyStein (V2 Python programming model) or V4 Node programming model apps, as those require the EnableWorkerIndexing feature flag
Existing prog model apps that set the EnableWorkerIndexing flag for some reason
DF apps that also use the WebPubSub model in their code or specify it in their .csproj file
Reproduction
There are multiple ways to reproduce this error. Below are a few examples. The error should still exist in all OOProc languages, not just the one used in the example.
Using the upcoming programming models with extension bundles
Create a new Python V2 programming model (PyStein) application, with an HTTP starter, an orchestration, and an activity function.
Set AzureWebJobsFeatureFlags": "EnableWorkerIndexing" in the local.settings.json file
Make sure you are using extension bundles by specifying in the host.json file:
In the existing prog model, so long as your app doesn't require the WebPubSub extension and you don't set the EnableWorkerIndexing feature flag, your app should not be affected.
In the upcoming prog models, if your app doesn't require the WebPubSub extension, you can:
a. Not use extension bundles, and specify the extensions you need in an extensions.csproj file; or
b. Use a build of the host that includes the fix to https://github.com/Azure/azure-functions-host/issues/8870. This won't work in Azure as this fix hasn't started rolling out yet.
If your app requires both DF and WebPubSub, there are currently no known workarounds.
Description
There seems to be an issue in the WebPubSub extension (
Microsoft.Azure.WebJobs.Extensions.WebPubSub
) that overrides defaults for object serialization globally. In applications in which this extension is loaded by the host, this affects this line in the DF extension, serializing OOProc SDKs' payload in an unexpected format (enums are serialized as strings instead of numbers, and properties are camelcased when they shouldn't), causing errors for OOProc DF applications.This error is particularly exacerbated for upcoming programming models for Python (V2) and Node (V4), which require the
EnableWorkerIndexing
feature flag to be set. Before https://github.com/Azure/azure-functions-host/issues/8870, setting this flag meant that all extensions in an extension bundle are loaded, even if they aren't used by the application. This means that any app using extension bundles (current or upcoming programming model) that sets theEnableWorkerIndexing
flag, would experience this issue, unless they run a host version which includes the fix for https://github.com/Azure/azure-functions-host/issues/8870 (not yet rolled out in Azure).Who's Affected
This issue affects app where both the WebPubSub extension and the DF extension are loaded. This can be:
EnableWorkerIndexing
feature flagEnableWorkerIndexing
flag for some reason.csproj
fileReproduction
There are multiple ways to reproduce this error. Below are a few examples. The error should still exist in all OOProc languages, not just the one used in the example.
Using the upcoming programming models with extension bundles
AzureWebJobsFeatureFlags": "EnableWorkerIndexing"
in thelocal.settings.json
filehost.json
file:func start
and try calling your orchestratorThis is true for the latest version of core tools (
4.0.4915
) running the latest version of the host (4.14.0.19631
) since the fix for https://github.com/Azure/azure-functions-host/issues/8870 isn't released yet.Setting the
EnableWorkerIndexing
flag on an existing programming model app using extension bundlesAzureWebJobsFeatureFlags": "EnableWorkerIndexing"
in thelocal.settings.json
filehost.json
file:func start
and try calling your orchestratorThis is true for the latest version of core tools (
4.0.4915
) running the latest version of the host (4.14.0.19631
) since the fix for https://github.com/Azure/azure-functions-host/issues/8870 isn't released yet.Explicitly adding the WebPubSub extension to a
.csproj
filehost.json
fileextension.csproj
file that contains the DF extension and the WebPubSub extension, as below:func extensions install
to install the extensionsfunc start
and try calling your orchestratorThis repro still occurs even with the fix to https://github.com/Azure/azure-functions-host/issues/8870, as using the
.csproj
file coerces the host into loading the WebPubSub extension even if it's not actively used by the app.Having a WebPubSub function in the same app as DF functions
host.json
file:index.ts
:function.json
:func start
and try to call your orchestratorThis repro still occurs even with the fix to https://github.com/Azure/azure-functions-host/issues/8870. The WebPubSub extension is always loaded regardless, since it is required by the app.
Known workarounds
In the existing prog model, so long as your app doesn't require the
WebPubSub
extension and you don't set theEnableWorkerIndexing
feature flag, your app should not be affected.In the upcoming prog models, if your app doesn't require the WebPubSub extension, you can:
a. Not use extension bundles, and specify the extensions you need in an
extensions.csproj
file; or b. Use a build of the host that includes the fix to https://github.com/Azure/azure-functions-host/issues/8870. This won't work in Azure as this fix hasn't started rolling out yet.If your app requires both DF and WebPubSub, there are currently no known workarounds.