Reputation: 11
I've been searching for a way to use Azure 'App Configuration' to store the connection string of an Azure Storage Queue. After hours searching on the Web I'm even more confused--there seems to be conflicting opinions on how to do this. Maybe even using Managed Identity, but that makes debugging locally a nightmare.
What I want is something like this:
[Function("foo")
public void foo([QueueTrigger("bar", Connection = "FooConnection")] QueueMessage message)
Where "FooConnection" is the name of a 'key' in an Azure App Configuration from which the connection string is specified. adly, it seems that Azure only looks in the 'Configuration' of the function (or local settings if running locally).
So, is this even possible?
Note: I do 'AddAzureAppConfiguration(..) in my HostBuilder.
Thanks in advance,
I've tried to surround the name with '%' like "%FooConnection%", but I get an error saying the expression did not evaluate to a value.
I've seen posts that speak so an expression pattern, but there is not much guidance on it.
Upvotes: 0
Views: 422
Reputation: 601
Thanks for reaching out and reporting this issue. This quickstart article talks about integrating the Azure App Configuration within Azure Function App.
For QueueTrigger sample code, you can tweak the sample code provided here. Please test it locally first before you deploy to Azure. In this sample, the queuename is defined within the App Configuration. You can modify it to fetch the queue connection string. Also refer this github thread for more information regarding using App config with Azure Function app..
Hope this helps.
Upvotes: 0