Azure WebJobs won't get triggered from Azure Storage Queue
Context
- I am using Python 3.12 / Linux setup on Azure
- I have deployed Django on Azure Web Services
- I also have Django Celery deployed as Azure WebJobs on the same service
Problem
The celery runs absolutely fine.
However, when I set up a trigger from the storage queue, it doesn't work. I try by manually sending a message in the Queue.
Here are some code for reference
function.json
{
"bindings": [
{
"name": "myQueueItem",
"type": "queueTrigger",
"direction": "in",
"queueName": "%AZURE_STORAGE_QUEUE_NAME%",
"connection": "AzureWebJobsStorage"
}
],
"disabled": false
}
settings.job
{
"stopping_wait_time": 60,
"is_singleton": true
}
run.sh
#!/bin/bash
# Activate the Python environment
echo "Triggerd"
Attempts
- I was initially trying Managed Identity so I set up following environment variables (or app settings)
AzureWebJobsStorage__credential: 'managedidentity'
AzureWebJobsStorage__accountName: storageAccount.name
AzureWebJobsStorage__queueServiceUri: 'https://${storageAccount.name}.queue.${storageSuffix}/'
- I have also attempted to setup via Connection String. I copied from Azure Storage Account UI/UX. I was able to connect from my local system.
I have tried combination of 1 and 2 along with different configuration in function.json
, nothing works.
Edit:
- For added context, I have also given
Storage Blob Data Contributor
andStorage Queue Data Contributor
to Azure Web App Service.