{
  "id": "event-3",
  "title": "Outbound Events: How do I stream events to Azure Event Grid?",
  "description": "Configure event streaming to Azure Event Grid for serverless event processing. Trigger Azure Functions, Logic Apps, or other Azure services when graph data changes.",
  "category": "Outbound Events",
  "tags": [
    "Outbound Events",
    "Azure Event Grid",
    "Azure",
    "Serverless",
    "Event-Driven"
  ],
  "api": "Outbound Events",
  "language": "Json",
  "lastUpdated": "2026-07-15",
  "openApiEndpoints": [
    "/configs/v1/event-sinks"
  ],
  "relatedGuides": [
    "/guides/guide-outbound-events",
    "/guides/guide-sandbox"
  ],
  "commonErrors": [
    {
      "code": "401",
      "message": "UNAUTHENTICATED",
      "solution": "Verify ServiceAccount credentials are valid"
    },
    {
      "code": "400",
      "message": "INVALID_ARGUMENT",
      "solution": "Check event sink configuration format and destination URL"
    }
  ],
  "summary": "This example streams graph events to Azure Event Grid:\n\nAzure Event Grid benefits:\n- Native Azure integration (Functions, Logic Apps, etc.)\n- Serverless event routing\n- High availability and scalability\n- Event filtering at the grid level\n\nEvent type in this example:\nindykite.audit.capture.upsert.node (node create/update only)\n\nUse with Azure:\n- Azure Functions: Trigger code on events\n- Logic Apps: Workflow automation\n- Event Hubs: Stream analytics\n- Custom webhooks: Any HTTP endpoint",
  "usecase": "Scenario: Trigger an Azure Function whenever a Pontiac car is added to inventory.\n\nConfiguration:\n- Event type: indykite.audit.capture.upsert.node (upsert only, not delete)\n- Filter: Car nodes where manufacturer=\"pontiac\"\n- Destination: Azure Event Grid topic\n\nAzure Function workflow:\n1. Car(manufacturer:\"pontiac\") ingested in IndyKite\n2. Event sent to Azure Event Grid\n3. Azure Function triggered\n4. Function processes event (e.g., sends notification, updates dashboard)\n\nThis enables reactive, serverless architectures with IndyKite as the data source.",
  "requirements": "Prerequisites:\n- ServiceAccount credentials: For configuration (Bearer token)\n- AppAgent credentials: For data ingestion (X-IK-ClientKey)\n- Azure Event Grid topic: With endpoint URL and access key\n\nAzure setup:\n- Create Event Grid topic in Azure portal\n- Note the topic endpoint URL\n- Generate access key for authentication",
  "steps": "Step 1: Set Up Azure Event Grid Topic\n- Action: Create Event Grid topic in Azure portal\n- Note: Topic endpoint URL and access key needed\n\nStep 2: Create Event Sink Configuration\n- Authentication: ServiceAccount credential (Bearer token)\n- Action: POST Event Sink with:\n  - Provider: Azure Event Grid\n  - Event type: indykite.audit.capture.upsert.node\n  - Filters: Car label, manufacturer=\"pontiac\"\n  - Endpoint: Your Event Grid topic URL\n- Result: Event Sink active\n\nStep 3: Ingest Matching Nodes\n- Authentication: AppAgent credential (X-IK-ClientKey)\n- Action: POST Car nodes with manufacturer=\"pontiac\"\n- Result: Events delivered to Azure Event Grid\n\nStep 4-5: Add More Nodes and Verify\n- Add additional matching nodes\n- Check Azure portal for received events\n- Verify non-matching nodes don't trigger events",
  "code": [
    {
      "step": "Step 2",
      "description": "Create an EventSink configuration. ",
      "filename": "POST https://eu.api.indykite.com/configs/v1/event-sinks",
      "language": "Json",
      "ingest": {
        "project_id": "your_project_gid",
        "description": "description of eventsink",
        "display_name": "eventsink name",
        "name": "eventsink-name",
        "include_cdc_events": false,
        "providers": {
          "provider-with-azure-event-grid": {
            "azure_event_grid": {
              "topic_endpoint": "https://your-topic.westeurope-1.eventgrid.azure.net/api/events",
              "access_key": "secret-access-key"
            }
          }
        },
        "routes": [
          {
            "provider_id": "provider-with-azure-event-grid",
            "event_type_key_values_filter": {
              "context_key_value": [
                {
                  "key": "manufacturer",
                  "value": "pontiac"
                },
                {
                  "key": "captureLabel",
                  "value": "Car"
                }
              ],
              "event_type": "indykite.audit.capture.upsert.node"
            },
            "stop_processing": true,
            "display_name": "Configuration Audit Events"
          }
        ]
      }
    },
    {
      "step": "Step 3",
      "description": "Capture the nodes needed for this use case.",
      "filename": "POST https://eu.api.indykite.com/capture/v1/nodes/",
      "ingest": {
        "nodes": [
          {
            "external_id": "alice",
            "is_identity": true,
            "type": "Person",
            "properties": [
              {
                "type": "email",
                "value": "alice@email.com"
              },
              {
                "type": "given_name",
                "value": "Alice"
              },
              {
                "type": "last_name",
                "value": "Smith"
              }
            ]
          },
          {
            "external_id": "knightrider",
            "type": "Person",
            "is_identity": true,
            "properties": [
              {
                "type": "email",
                "value": "knightrider@demo.com"
              },
              {
                "type": "name",
                "value": "Michael Knight"
              }
            ]
          },
          {
            "external_id": "satchmo",
            "type": "Person",
            "is_identity": true,
            "properties": [
              {
                "type": "email",
                "value": "satchmo@demo.com"
              },
              {
                "type": "name",
                "value": "Louis Armstrong"
              }
            ]
          },
          {
            "external_id": "karel",
            "type": "Person",
            "is_identity": true,
            "properties": [
              {
                "type": "email",
                "value": "karel@demo.com"
              },
              {
                "type": "name",
                "value": "Karel Plihal"
              }
            ]
          },
          {
            "external_id": "kitt",
            "type": "Car",
            "is_identity": false,
            "properties": [
              {
                "type": "manufacturer",
                "value": "pontiac"
              },
              {
                "type": "model",
                "value": "Firebird"
              }
            ]
          },
          {
            "external_id": "cadillacv16",
            "type": "Car",
            "is_identity": false,
            "properties": [
              {
                "type": "manufacturer",
                "value": "Cadillac"
              },
              {
                "type": "model",
                "value": "V-16"
              }
            ]
          },
          {
            "external_id": "harmonika",
            "type": "Bus",
            "is_identity": false,
            "properties": [
              {
                "type": "manufacturer",
                "value": "Ikarus"
              },
              {
                "type": "model",
                "value": "280"
              }
            ]
          },
          {
            "external_id": "listek",
            "type": "Ticket",
            "is_identity": false
          },
          {
            "external_id": "airbook-xyz",
            "type": "Laptop",
            "is_identity": false
          }
        ]
      }
    },
    {
      "step": "Step 4",
      "description": "Capture the nodes needed for this use case.",
      "filename": "POST https://eu.api.indykite.com/capture/v1/nodes/",
      "ingest": {
        "nodes": [
          {
            "external_id": "kitten",
            "type": "Car",
            "is_identity": false,
            "properties": [
              {
                "type": "manufacturer",
                "value": "pontiac"
              },
              {
                "type": "model",
                "value": "Bonneville"
              }
            ]
          },
          {
            "external_id": "kitty",
            "type": "Car",
            "is_identity": false,
            "properties": [
              {
                "type": "manufacturer",
                "value": "pontiac"
              },
              {
                "type": "model",
                "value": "Catalina"
              }
            ]
          }
        ]
      }
    }
  ],
  "links": {
    "html": "/resources/event-3",
    "markdown": "/resources/event-3.md",
    "openApi": "https://openapi.indykite.com/"
  }
}