Azure Queue Storage¶
Azure Queue Storage event-source allows you to consume messages from azure storage queues.
Event Structure¶
The structure of an event dispatched by the event-source over the eventbus looks like following,
{
"context": {
"id": "unique_event_id",
"source": "name_of_the_event_source",
"specversion": "cloud_events_version",
"type": "type_of_event_source",
"datacontenttype": "type_of_data",
"subject": "name_of_the_configuration_within_event_source"
"time": "event_time",
},
"data": {
"messageID": "MessageID is the ID of the message",
"body": "Body represents the message body",
"insertionTime": "InsertionTime is the time the message was inserted into the queue",
}
}
Setup¶
-
Create a queue called
test
either using az cli or Azure storage management console. -
Fetch your connection string for Azure Queue Storage and base64 encode it.
-
Create a secret called
azure-secret
as follows.apiVersion: v1 kind: Secret metadata: name: azure-secret type: Opaque data: connectionstring: <base64-connection-string>
-
Deploy the secret.
kubectl -n argo-events apply -f azure-secret.yaml
-
Create the event source by running the following command.
kubectl apply -n argo-events -f https://raw.githubusercontent.com/argoproj/argo-events/stable/examples/event-sources/azure-queue-storage.yaml
-
Inspect the event-source pod logs to make sure it was able to listen to the queue specified in the event source to consume messages.
-
Create a sensor by running the following command.
kubectl apply -n argo-events -f https://raw.githubusercontent.com/argoproj/argo-events/stable/examples/sensors/azure-queue-storage.yaml
-
Dispatch a message to the queue.
az storage message put -q test --content {"message": "hello"}' --account-name mystorageaccount --connection-string "<the-connection-string>"
-
Once a message is published, an argo workflow will be triggered. Run
argo list
to find the workflow.
Troubleshoot¶
Please read the FAQ.