Arcus Event Grid Proxy

website·Indexed 32 days ago

https://eventgrid-proxy.arcus-azure.net/

A containerized proxy that simplifies integration with Azure Event Grid by providing a hosted REST API to POST events for forwarding. Features include a health endpoint, configurable runtime for container deployment, and support for pushing events via API v1.

Tokens
811
Snippets
5
Records
7
Agent score
55%

What's inside Arcus Event Grid Proxy

  1. Understand Event Grid Proxy architecture and deployment

    The Event Grid Proxy provides a hosted REST API that accepts POST requests containing events and forwards them to a specified Azure Event Grid Topic. It is designed for flexibility in deployment: it can be run as a sidecar container alongside an application or deployed as a standalone application within your infrastructure.
  2. Run Arcus Event Grid Proxy using Docker

    Arcus Event Grid Proxy is a containerized service that simplifies integration with Azure Event Grid. It allows you to push events to Azure Event Grid via REST and monitor the runtime via a health endpoint. To start the proxy, run the Docker image from Docker Hub and provide the required Azure Event Grid environment variables.
    docker run -d -p 8999:80 --name arcus arcusazure/arcus-event-grid-proxy \
      -e ARCUS_EVENTGRID_TOPICENDPOINT=<your_endpoint> \
      -e ARCUS_EVENTGRID_AUTHKEY=<your_auth_key>
  3. Push events to a topic via the Event Grid Proxy

    Events can be pushed to a topic using a POST request to the proxy API. A successful request returns an HTTP 204 No Content response, while failures return an HTTP 503. The response includes event metadata in headers such as X-Event-Id, X-Event-Subject, X-Event-Timestamp, and X-Event-Data-Version.
    curl -X POST "http://localhost:8999/api/v1/events/Arcus.NewCarRegistered" \
         -H "accept: text/plain" \
         -H "Content-Type: application/json-patch+json" \
         -d "{ \"licensePlate\": \"1-ABC-337\"}" \
         --include
  4. Select a Docker tag for Event Grid Proxy deployments

    Choose a Docker tag based on your requirements for stability and update frequency:

    • latest: Best for experimentation and proof-of-concepts. Not recommended for production.
    • {major}.{minor}: Tracks a specific feature set. This tag is updated automatically with feature and security patches.
    • {major}.{minor}.{patch}: Pins the deployment to a specific version of the runtime for maximum stability.
    • Image Digest: Pinning to a specific digest ensures the exact same image is used across all infrastructure, though this prevents automatic security patches unless a dependency update tool like Renovate is used.
  5. Configure Event Grid Proxy network and Azure Event Grid topic

    The Event Grid Proxy container is configured using environment variables. It currently supports pushing events to a single Azure Event Grid topic.
    # Network Configuration
    ARCUS_HTTP_PORT=80 # Defines the port to serve HTTP traffic (default is 80)
    
    # Azure Event Grid Topic Configuration
    ARCUS_EVENTGRID_TOPICENDPOINT=<Url of the topic to push to>
    ARCUS_EVENTGRID_AUTHKEY=<Authentication key to authenticate with>
  6. Check runtime health using the Health Endpoint

    The Event Grid Proxy exposes a health endpoint to indicate if the runtime is capable of serving traffic. This endpoint is designed for integration with Kubernetes liveness and readiness probes to determine if a container has started successfully or remains healthy.

    • Success: Returns HTTP 200 OK.
    • Failure: Returns HTTP 503 Service Unavailable.
    curl -X GET "http://localhost:88/api/v1/health" -H "accept: application/json" --include
  7. Configure event metadata using optional query parameters

    When pushing events via the proxy, you can override default event metadata by providing the following query parameters in the request URL:
    - eventId: Unique id for your event (default: Guid)
    - eventTimestamp: Timestamp of event (default: UTC)
    - eventSubject: Subject of event (default: /)
    - dataVersion: Version of data payload (default: 1.0)