2

I've followed the azure guides on setting up a managed identity for Service Bus. I'm running into the following error:

Service Bus account connection string 'ServiceBusConnection' does not exist.

I do have the "connection" in the function.json listed as "ServiceBusConnection"

In the live metrics I get this error when sending from the queue.

Service Bus account connection string 'ServiceBus' does not exist. Make sure that it is a defined App Setting.

I do have in my settings for the function app and locally the following configuration:

"ServiceBusConnection_fullyQualifiedNamespace":"<xxxxx>.servicebus.windows.net"

I've also defined AzureWebJobsStorage__accountName

I seem to be very stuck, followed the azure guides, can't find anything I'm doing wrong.

Nehemiah
  • 61
  • 3
  • 1
    so once deployed do you have a `ServiceBusConnection_fullyQualifiedNamespace` app setting ? `local.settings.json` is not published by default. – Thomas Jul 17 '22 at 23:34
  • @Thomas yes. I have it listed in the configuration of the function app. – Nehemiah Jul 17 '22 at 23:37
  • Oh I think there is a typo you have only one _ but you should have two: `ServiceBusConnection__fullyQualifiedNamespace` – Thomas Jul 17 '22 at 23:56
  • you can also define it like that: `ServiceBusConnection:fullyQualifiedNamespace` – Thomas Jul 17 '22 at 23:56
  • @Thomas good eye, in my settings.json I had one underscore, but in the deployment i have two. So i'm still stumped there – Nehemiah Jul 18 '22 at 06:55
  • so it s working locally ? – Thomas Jul 18 '22 at 07:03
  • Also do you have the managed identity set up properly ? – Thomas Jul 18 '22 at 07:03
  • @Thomas there might be some more configurations i didn't set up locally. I'm more focused on the deployment truthfully. Managed identity I have set up working properly with other aspects, I think I set it up properly here. However it's possible I missed something. I gave the managed identity permissions over the storage. – Nehemiah Jul 18 '22 at 07:23
  • I'd also add that i'm getting this error in the live metrics: The listener for function 'Functions.TimerTrigger' was unable to start AuthorizationPermissionMismatch – Nehemiah Jul 18 '22 at 07:26
  • you would need to set up permission to servicebus as well tho – Thomas Jul 18 '22 at 07:41
  • I did set up service bus permissions with the recommended permissions. I'm also not sure that explain this error: Service Bus account connection string 'ServiceBus' does not exist. Make sure that it is a defined App Setting. – Nehemiah Jul 18 '22 at 07:44
  • so still the same error .... – Thomas Jul 18 '22 at 07:51
  • Unfortunately i've made no progress on this. – Nehemiah Jul 18 '22 at 07:55
  • which azure function runtime are you using? v4 ? could you confirm it is working fine locally ? – Thomas Jul 18 '22 at 08:13
  • v4. I can confirm it's working locally, however I have Function TimerTrigger disabled. But the serviceBusQueueTrigger is working as expected – Nehemiah Jul 18 '22 at 08:19

1 Answers1

3

Wow, this took me too long to figure out, although I'm not sure why it behaves this way.

Looks like the error message I was getting was very telling.

I switched "ServiceBusConnection_fullyQualifiedNamespace" to "ServiceBus_fullyQualifiedNamespace" because it said Service Bus account connection string 'ServiceBus' does not exist.

This did work. I'm still unclear as to why I can't name the connection prefix as I please.

Connection string details here

Nehemiah
  • 61
  • 3