So I have a solution which is using App Configuration and Managed Identity.
A function app is linked to ServiceBus as a trigger, to use managed identity it needs a configuration parameter called ServiceBusConnection__fullyQualifiedNamespace. If I add that to me local.settings then the functions will run. So I know the ServiceBus and Identity is set up correctly.
If I add this to my App Configuration then it won't run, in App Configuration you have to replace the __ with a : or similar.
When the function app starts I can look at the configuration settings. And in those settings I can see the ServiceBusConnection:fullyQualifiedNamespace correctly and the provider is App Configuration, so I know that the connection to App Configuration is working okay.
I have tried many combinations and so far have not made any progress. The errors I get vary depending on setting but usually
"The listener for function 'Functions.TbQueueTrigger' was unable to start. Azure.Messaging.ServiceBus: The connection string could not be parsed; either it was malformed or contains no well-known tokens"
But the string contains exactly the same (FQN) as the local.settings. Now this is when I have the settings in both local.settings AND AppConfiguration. If I look in the Config data I can see the App Configuration choices and not the local.settings.
If I remove the parameters from local.settings then the error is
"The listener for function 'Functions.TbQueueTrigger' was unable to start. Microsoft.Azure.WebJobs.Extensions.ServiceBus: Service Bus account connection string with name 'ServiceBusConnection' does not exist in the settings. Make sure that it is a defined App Setting."
So I looks like the function trigger is NOT looking in App Configuration at all. In which case the Run is decorated as such
public async Task Run([ServiceBusTrigger("notifications-dev", Connection = "ServiceBusConnection")]
ServiceBusReceivedMessage message
)
So what am I missing? How can I force the trigger to use App Configuration here? Is there a better way to decorate the function or ensure that the ServiceBus is set up correctly?
thanks!
So I have a solution which is using App Configuration and Managed Identity.
A function app is linked to ServiceBus as a trigger, to use managed identity it needs a configuration parameter called ServiceBusConnection__fullyQualifiedNamespace. If I add that to me local.settings then the functions will run. So I know the ServiceBus and Identity is set up correctly.
If I add this to my App Configuration then it won't run, in App Configuration you have to replace the __ with a : or similar.
When the function app starts I can look at the configuration settings. And in those settings I can see the ServiceBusConnection:fullyQualifiedNamespace correctly and the provider is App Configuration, so I know that the connection to App Configuration is working okay.
I have tried many combinations and so far have not made any progress. The errors I get vary depending on setting but usually
"The listener for function 'Functions.TbQueueTrigger' was unable to start. Azure.Messaging.ServiceBus: The connection string could not be parsed; either it was malformed or contains no well-known tokens"
But the string contains exactly the same (FQN) as the local.settings. Now this is when I have the settings in both local.settings AND AppConfiguration. If I look in the Config data I can see the App Configuration choices and not the local.settings.
If I remove the parameters from local.settings then the error is
"The listener for function 'Functions.TbQueueTrigger' was unable to start. Microsoft.Azure.WebJobs.Extensions.ServiceBus: Service Bus account connection string with name 'ServiceBusConnection' does not exist in the settings. Make sure that it is a defined App Setting."
So I looks like the function trigger is NOT looking in App Configuration at all. In which case the Run is decorated as such
public async Task Run([ServiceBusTrigger("notifications-dev", Connection = "ServiceBusConnection")]
ServiceBusReceivedMessage message
)
So what am I missing? How can I force the trigger to use App Configuration here? Is there a better way to decorate the function or ensure that the ServiceBus is set up correctly?
thanks!
Share Improve this question asked Nov 19, 2024 at 9:02 paulinventomepaulinventome 1,1572 gold badges10 silver badges14 bronze badges 3 |1 Answer
Reset to default 1ServiceBus, Managed ID, Azure Functions and App Configuration not working together
It worked for me using below process:
Firstly created a function and deployed to azure and then in Environment Variables:
I have given Azure Service Bus Receiver role to Function app's identity:
Output:
If you have integrated in App Configuration service then you need to follow steps:
Firstly create:
then IAM give the App Conjuration Data Owner and Contributor role:
Then wait for 10 min and then add this to Environment Variables:
@Microsoft.AppConfiguration(Endpoint=https://rithwik98.azconfig.io; Key=test)
After adding then pull reference.
Output:
Program.cs
file. – Harshitha Commented Nov 19, 2024 at 9:09