I have created an Azure Functions project and am testing it locally. Below is my code that creates a cloud queue. It then adds id returned from my CarComponent.
[FunctionName("CarDiscovery")]
public static void Run([TimerTrigger("0 */5 * * * *")]TimerInfo myTimer, TraceWriter log)
{
log.Info($"C# Timer trigger function executed at: {DateTime.Now}");
var connectionString = "UseDevelopmentStorage=true";
// Parse the connection string and return a reference to the storage account.
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(connectionString);
CloudQueueClient queueClient = storageAccount.CreateCloudQueueClient();
// Retrieve a reference to a container.
CloudQueue queue = queueClient.GetQueueReference("discovery-queue");
// Create the queue if it doesn't already exist
queue.CreateIfNotExists();
CarComponent cars = new CarComponent();
var carList = cars.GetActiveCars();
foreach (var car in carList)
{
byte[] toAdd = BitConverter.GetBytes(car.Id);
CloudQueueMessage message = new CloudQueueMessage(toAdd); // <-- Put the ID of each metro in the message
queue.AddMessage(message);
}
}
When I start the function using the azure storage emulator it runs successfully.
I would like to create a another azure function that runs with a Queue trigger that I can test locally.
(1) Where do I go to view the current messages that have been added to development storage?
(2) What do I specify as the connection when creating the Azure function with the queue trigger? (see below)