Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to pass CustomEndpointAddress to ServiceBusClientOptions #2853

Open
scrocquesel-ml150 opened this issue Nov 12, 2024 · 7 comments
Open
Labels

Comments

@scrocquesel-ml150
Copy link

Description

We are using a docker container to emulate Azure Service Bus, while it works like a charm with Azure SDK Client, it seems Azure Function do not use the same client factory as Microsoft.Extensions.Azure.

In other words, we want the client to be create with

    var sbClient = new ServiceBusClient(configSection["fullyQualifiedNamespace"],
            new ServiceBusClientOptions()
            {
                TransportType = configSection["transportType"],
                CustomEndpointAddress = configSection["customEndpointAddress"],
            });

The factory in Microsoft.Extensions.Azure make use of reflection to bind the config section to the ServiceBusClientOptions.
Something similar is done in the webjobs extension but it misses the CustomEndpointAddress property.

@jviau
Copy link
Contributor

jviau commented Nov 13, 2024

In dotnet isolated the service bus client used is in an entirely different process, so configuration via code won't be possible here. @JoshLove-msft is it possible to read this value from IConfiguration in the WebJobs extension? Or is it already supported?

@JoshLove-msft
Copy link
Member

Yes, this is already supported in the WebJobs extension.

@jviau
Copy link
Contributor

jviau commented Nov 14, 2024

Yes, this is already supported in the WebJobs extension.

@JoshLove-msft is it supported via configuration? Or is it code only?

@JoshLove-msft
Copy link
Member

My mistake - the CustomEndpointAddress is not available in the webjobs extension via config or code. It would need to be added into the ServiceBusOptions type, and then consumed in the builder extension. Is the ask here to support it in the WebJobs extension?

@scrocquesel-ml150
Copy link
Author

scrocquesel-ml150 commented Nov 14, 2024

My mistake - the CustomEndpointAddress is not available in the webjobs extension via config or code. It would need to be added into the ServiceBusOptions type, and then consumed in the builder extension. Is the ask here to support it in the WebJobs extension?

Yes, my request is to be able to pass the CustomEndpointAddress with the connection configuration section to the dotnet isolated service bus trigger. Does the webJobs extension is for both isolated and inprocess ?

@jviau
Copy link
Contributor

jviau commented Nov 14, 2024

Yes, the ask would be to support this in the WebJobs extension. This will cover both in-proc and isolated.

@scrocquesel-ml150 when supported, you will need to set it via host.json or an app setting / env variable. This is because in dotnet isolated, the host process loads the WebJobs versions of the extensions, and that is what performs all interactions with the actual service bus.

@JoshLove-msft
Copy link
Member

Sounds good, I will file this in the azure-sdk-for-net repo where the code lives.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants