I have been testing my Azure Functions using a QueueTrigger
. I tested my queue by using the following code to put something on the queue.
CloudStorageAccount storageAccount = CloudStorageAccount.Parse("DefaultEndpointsProtocol=https;AccountName=storage.....etc");CloudQueueClient queueClient = storageAccount.CreateCloudQueueClient();CloudQueue queue = queueClient.GetQueueReference("mysecondqueue");queue.CreateIfNotExists();queue.AddMessage(new CloudQueueMessage($"Test {DateTime.Now}"));
This works fine, however what I need to do is put this code in a Nuget package. What bothers me is that I have to put the ConnectionString
of my StorageAccount hard coded in that Nuget package. And this package will be used by 3rd party applications.
I could use an Azure Function with an HttpTrigger
, but that kind of defeats the purpose of using a Queue.
What would be the best way to put something on a Queue from a Nuget package using a QueueTrigger
, without exposing the ConnectionString
of my Storage Account?
Or is my only option using a HttpTrigger
in this case?