I’ve created an Azure Functions app and dockerized it. The container is running and doesn’t give me any errors. Now I want this function app to be triggered by a storage queue insertion. I’ve read the microsoft docs and added the trigger in my function.json file.
{
"name": "myQueueItem",
"type": "queueTrigger",
"direction": "in",
"queueName": "searches",
"connection": "StorageAccountConnectionString"
}
The StorageAccountConnectionString is an app setting which I added to the functions app in the azure portal under configuration.
I verified the existence of the searches queue as well.
Now nothing seems to be happening when I insert a message into the searches queue. The dequeue counts doesn’t increment, and the function execution counter also doesn’t change.
Does anyone know how I can make this work?
2
Answers
I have no idea, but it was fixed by generating a function from VS Code Azure Functions extension. Then the function picked up the queue change.
If you are deploying the docker image to the function app then you can setup the environment variable in the docker file itself.
just add the following command in your dockerfile.
You can also refer to this article by Kevin lee