© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•11mo ago•
96 replies
Tostisto

Azure function connection string from azure app configuration store

Hello, I need some help. I have an Azure Function that is triggered by a Service Bus queue message. One of the parameters is the connection string to the Service Bus. My problem is that I am using Azure App Configuration Store to store shared connection strings between apps.

The connection strings are stored in the configuration in-memory like this:
configuration = configuration.AddInMemoryCollection(config);
configuration = configuration.AddInMemoryCollection(config);


However, there is a problem when I try to run the app. The Azure Function is not able to read the connection string from the configuration, and I am getting this error:
Service Bus account connection string with name ServiceBus:ConnectionString
Service Bus account connection string with name ServiceBus:ConnectionString


The function looks like this:

[Function(nameof(test))]
public async Task Run([ServiceBusTrigger("queue", Connection = "ServiceBus:ConnectionString")] ServiceBusReceivedMessage message, ServiceBusMessageActions messageActions)
{
    try
    {
        // Some logic here

        await messageActions.CompleteMessageAsync(message);
    }
    catch (Exception)
    {
        await messageActions.AbandonMessageAsync(message);
    }
}
[Function(nameof(test))]
public async Task Run([ServiceBusTrigger("queue", Connection = "ServiceBus:ConnectionString")] ServiceBusReceivedMessage message, ServiceBusMessageActions messageActions)
{
    try
    {
        // Some logic here

        await messageActions.CompleteMessageAsync(message);
    }
    catch (Exception)
    {
        await messageActions.AbandonMessageAsync(message);
    }
}


Am I able to load the connection string to servicebus from inmemory configuration?
Thanks for every response.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Azure data studio connection string.
C#CC# / help
3y ago
❔ How to get azure cache for Redis connection string stored in app service as a appsetting variable
C#CC# / help
3y ago
Error while pushing Azure ServiceBus connection string on github.
C#CC# / help
2y ago
Next page