Skip to content

Service bus binding runtime error: Could not load file or assembly #2630

@preslavgerchev

Description

@preslavgerchev

Deploying a new function app with a service bus binding leads to the following error:

Microsoft.Azure.WebJobs.Script: Error configuring services in an external startup class. Microsoft.Azure.WebJobs.Extensions.ServiceBus: Could not load file or assembly 'Microsoft.Extensions.Configuration.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyREDACTED (possible password or key detected)

The function uses a custom runtime as the underlying code is written in Go, excerpt from the function's env variables:

FUNCTIONS_WORKER_RUNTIME: "custom"
FUNCTIONS_EXTENSION_VERSION: "~4"

We use the latest bundle, here's the relevant bits from host.json:

"version": "2.0",
    "extensionBundle": {
        "id": "Microsoft.Azure.Functions.ExtensionBundle",
        "version": "[4.0.0, 5.0.0)"
    },

This has started to happen recently as we've had this setup (binding and code) since a few months and the code is untouched. We deploy this function app every night as part of an integration test pipeline and this is how we've spotted the issue surfacing last week.

The app insights, hooked to the function has this log:


Microsoft.Azure.WebJobs.Script.ExternalStartupException: Error configuring services in an external startup class.
---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Extensions.Configuration.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.

File name: 'Microsoft.Extensions.Configuration.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
at Microsoft.Extensions.Hosting.ServiceBusHostBuilderExtensions.AddServiceBus(IWebJobsBuilder builder, Action`1 configure)
at Microsoft.Extensions.Hosting.ServiceBusHostBuilderExtensions.AddServiceBus(IWebJobsBuilder builder)
at Microsoft.Azure.WebJobs.ServiceBus.ServiceBusWebJobsStartup.Configure(IWebJobsBuilder builder)
at Microsoft.Azure.WebJobs.WebJobsBuilderExtensions.ConfigureStartup(IWebJobsStartup startup, WebJobsBuilderContext context, IWebJobsBuilder builder) in D:\a\_work\1\s\src\Microsoft.Azure.WebJobs.Host\Hosting\WebJobsBuilderExtensions.cs:line 166
at Microsoft.Azure.WebJobs.WebJobsBuilderExtensions.ConfigureAndLogUserConfiguredServices(IWebJobsStartup startup, WebJobsBuilderContext context, IWebJobsBuilder builder, ILoggerFactory loggerFactory) in D:\a\_work\1\s\src\Microsoft.Azure.WebJobs.Host\Hosting\WebJobsBuilderExtensions.cs:line 130
at Microsoft.Azure.WebJobs.WebJobsBuilderExtensions.UseWebJobsStartup(IWebJobsBuilder builder, Type startupType, WebJobsBuilderContext context, ILoggerFactory loggerFactory) in D:\a\_work\1\s\src\Microsoft.Azure.WebJobs.Host\Hosting\WebJobsBuilderExtensions.cs:line 115
at Microsoft.Azure.WebJobs.WebJobsBuilderExtensions.UseExternalStartup(IWebJobsBuilder builder, IWebJobsStartupTypeLocator startupTypeLocator, WebJobsBuilderContext context, ILoggerFactory loggerFactory) in D:\a\_work\1\s\src\Microsoft.Azure.WebJobs.Host\Hosting\WebJobsBuilderExtensions.cs:line 213
at Microsoft.Azure.WebJobs.Script.ScriptHostBuilderExtensions.<>c__DisplayClass7_0.<AddScriptHostCore>b__1(HostBuilderContext context, IWebJobsBuilder webJobsBuilder) in /_/src/WebJobs.Script/ScriptHostBuilderExtensions.cs:line 235
--- End of inner exception stack trace ---

The function.json (binding) file looks like this:

{
    "bindings": [
        {
            "name": "msg",
            "type": "serviceBusTrigger",
            "direction": "in",
            "queueName": "<redacted>",
            "connection": "ServiceBusConnection"
        }
    ]
}

The identity that the function uses has owner permissions over the service bus, so no auth issues.

The function app has a few more bindings (mostly timers), around 10, that all refuse to start because of this issue we're seeing above.

Investigative information

Please provide the following:

  • Timestamp: 2025-07-21T07:09:56.6322431Z
  • Function App version: shows Error in the portal, so unable to determine this from there. the app insights log has this as a detail to the error message, shown above: azurefunctions: 4.640.100.0, so I assume that this is trying to run on 4.640.100.0.
  • Function App name: Unable to share as we'd like to keep this private.
  • Function name(s) (as appropriate): Unable to share as we'd like to keep this private.
  • Invocation ID: Unable to share this as the function does not even start
  • Region: UK South

Repro steps

Provide the steps required to reproduce the problem:

  1. Deploy a function app with a function, tied to a service bus binding. Use custom runtime
  2. The function will not even start and throws the error, described above. This can also be seen in the portal (UI)

Expected behavior

Provide a description of the expected behavior.

  1. The function to run.

Actual behavior

Provide a description of the actual behavior observed: The function does not start.

Known workarounds

Provide a description of any known workarounds: No workarounds to my knowledge, this fully blocks the function from being usable.

Related information

Provide any related information

  • Programming language used: the code that the bindings use is is written in Go (1.24)
  • Links to source
  • Bindings used

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions