github.com/argoproj/argo-events@v1.9.1/docs/sensors/triggers/azure-service-bus.md (about)

     1  # Azure Service Bus
     2  
     3  Service Bus Trigger allows a sensor to send messages to Azure Service Bus queues and topics.
     4  
     5  ## Specification
     6  
     7  The Azure Service Bus trigger specification is available [here](https://github.com/argoproj/argo-events/blob/master/api/sensor.md#azureservicebustrigger).
     8  
     9  ## Setup
    10  
    11  1. Create a queue called `test` either using Azure CLI or Azure Service Bus management console.
    12  
    13  1. Fetch your connection string for Azure Service Bus and base64 encode it.
    14  
    15  1. Create a secret called `azure-secret` as follows.
    16  
    17          apiVersion: v1
    18          kind: Secret
    19          metadata:
    20            name: azure-secret
    21          type: Opaque
    22          data:
    23            connectionstring: <base64-connection-string>
    24  
    25  1. Deploy the secret.
    26  
    27          kubectl -n argo-events apply -f azure-secret.yaml
    28  
    29  1. Let's set up a webhook event-source to process incoming requests.
    30  
    31          kubectl apply -n argo-events -f https://raw.githubusercontent.com/argoproj/argo-events/stable/examples/event-sources/webhook.yaml
    32  
    33  1. Create a sensor by running the following command.
    34  
    35          kubectl apply -n argo-events -f https://raw.githubusercontent.com/argoproj/argo-events/stable/examples/sensors/azure-service-bus-sensor.yaml
    36  
    37  1. The Service Bus message needs a body. In order to construct a messaged based on your event data, the Azure Service Bus sensor has the payload field as part of the trigger.
    38  
    39      The payload declared above will generate a message body like below,
    40  
    41          {
    42              "message": "some message here" // name/key of the object
    43          }
    44  
    45  1. Let's expose the webhook event-source pod using port-forward so that we can make a request to it.
    46  
    47          kubectl -n argo-events port-forward <name-of-event-source-pod> 12000:12000
    48  
    49  1. Use either Curl or Postman to send a post request to the http://localhost:12000/example.
    50  
    51          curl -d '{"message":"ok"}' -H "Content-Type: application/json" -X POST http://localhost:12000/example