{
  "schema": "https://ai-atoms.com/schemas/skill-v1.json",
  "type": "skill",
  "id": "skill/azure-eventgrid-py",
  "version": "1.0.1",
  "name": "Azure Eventgrid Py",
  "description": "Azure Event Grid SDK for Python. Use for publishing events, handling CloudEvents, and event-driven architectures.\nTriggers: \"event grid\", \"EventGridPublisherClient\", \"CloudEvent\", \"EventGridEvent\", \"publish events\".",
  "system_prompt_fragment": "# Azure Event Grid SDK for Python\n\nEvent routing service for building event-driven applications with pub/sub semantics.\n\n## Installation\n\n```bash\npip install azure-eventgrid azure-identity\n```\n\n## Environment Variables\n\n```bash\nEVENTGRID_TOPIC_ENDPOINT=https://<topic-name>.<region>.eventgrid.azure.net/api/events\nEVENTGRID_NAMESPACE_ENDPOINT=https://<namespace>.<region>.eventgrid.azure.net\n```\n\n## Authentication\n\n```python\nfrom azure.identity import DefaultAzureCredential\nfrom azure.eventgrid import EventGridPublisherClient\n\ncredential = DefaultAzureCredential()\nendpoint = \"https://<topic-name>.<region>.eventgrid.azure.net/api/events\"\n\nclient = EventGridPublisherClient(endpoint, credential)\n```\n\n## Event Types\n\n| Format | Class | Use Case |\n|--------|-------|----------|\n| Cloud Events 1.0 | `CloudEvent` | Standard, interoperable (recommended) |\n| Event Grid Schema | `EventGridEvent` | Azure-native format |\n\n## Publish CloudEvents\n\n```python\nfrom azure.eventgrid import EventGridPublisherClient, CloudEvent\nfrom azure.identity import DefaultAzureCredential\n\nclient = EventGridPublisherClient(endpoint, DefaultAzureCredential())\n\n# Single event\nevent = CloudEvent(\n    type=\"MyApp.Events.OrderCreated\",\n    source=\"/myapp/orders\",\n    data={\"order_id\": \"12345\", \"amount\": 99.99}\n)\nclient.send(event)\n\n# Multiple events\nevents = [\n    CloudEvent(\n        type=\"MyApp.Events.OrderCreated\",\n        source=\"/myapp/orders\",\n        data={\"order_id\": f\"order-{i}\"}\n    )\n    for i in range(10)\n]\nclient.send(events)\n```\n\n## Publish EventGridEvents\n\n```python\nfrom azure.eventgrid import EventGridEvent\nfrom datetime import datetime, timezone\n\nevent = EventGridEvent(\n    subject=\"/myapp/orders/12345\",\n    event_type=\"MyApp.Events.OrderCreated\",\n    data={\"order_id\": \"12345\", \"amount\": 99.99},\n    data_version=\"1.0\"\n)\n\nclient.send(event)\n```\n\n## Event Properties\n\n### CloudEvent Properties\n\n```python\nevent = CloudEvent(\n    type=\"MyApp.Events.ItemCreated\",      # Required: event type\n    source=\"/myapp/items\",                 # Required: event source\n    data={\"key\": \"value\"},                 # Event payload\n    subject=\"items/123\",                   # Optional: subject/path\n    datacontenttype=\"application/json\",   # Optional: content type\n    dataschema=\"https://schema.example\",  # Optional: schema URL\n    time=datetime.now(timezone.utc),      # Optional: timestamp\n    extensions={\"custom\": \"value\"}         # Optional: custom attributes\n)\n```\n\n### EventGridEvent Properties\n\n```python\nevent = EventGridEvent(\n    subject=\"/myapp/items/123\",            # Required: subject\n    event_type=\"MyApp.ItemCreated\",        # Required: event type\n    data={\"key\": \"value\"},                 # Required: event payload\n    data_version=\"1.0\",                    # Required: schema version\n    topic=\"/subscriptions/.../topics/...\", # Optional: auto-set\n    event_time=datetime.now(timezone.utc)  # Optional: timestamp\n)\n```\n\n## Async Client\n\n```python\nfrom azure.eventgrid.aio import EventGridPublisherClient\nfrom azure.identity.aio import DefaultAzureCredential\n\nasync def publish_events():\n    credential = DefaultAzureCredential()\n    \n    async with EventGridPublisherClient(endpoint, credential) as client:\n        event = CloudEvent(\n            type=\"MyApp.Events.Test\",\n            source=\"/myapp\",\n            data={\"message\": \"hello\"}\n        )\n        await client.send(event)\n\nimport asyncio\nasyncio.run(publish_events())\n```\n\n## Namespace Topics (Event Grid Namespaces)\n\nFor Event Grid Namespaces (pull delivery):\n\n```python\nfrom azure.eventgrid.aio import EventGridPublisherClient\n\n# Namespace endpoint (different from custom topic)\nnamespace_endpoint = \"https://<namespace>.<region>.eventgrid.azure.net\"\ntopic_name = \"my-topic\"\n\nasync with EventGridPublisherClient(\n    endpoint=namespace_endpoint,\n    credential=DefaultAzureCredential()\n) as client:\n    await client.send(\n        event,\n        namespace_topic=topic_name\n    )\n```\n\n## Best Practices\n\n1. **Use CloudEvents** for new applications (industry standard)\n2. **Batch events** when publishing multiple events\n3. **Include meaningful subjects** for filtering\n4. **Use async client** for high-throughput scenarios\n5. **Handle retries** — Event Grid has built-in retry\n6. **Set appropriate event types** for routing and filtering\n\n## When to Use\nThis skill is applicable to execute the workflow or actions described in the overview.",
  "applicable_domains": [
    "devops"
  ],
  "category": "devops",
  "invocation": [
    "/azure-eventgrid-py"
  ],
  "authored_by": "claudeskills.in community",
  "source_url": "https://claudeskills.in/skill/azure-eventgrid-py",
  "provenance": {
    "source": "claudeskills.in",
    "source_url": "https://claudeskills.in/skill/azure-eventgrid-py",
    "license": "unknown",
    "imported_at": "2026-09-03",
    "notes": "Aggregated by claudeskills.in from community GitHub lists."
  },
  "tags": [
    "claudeskills",
    "devops"
  ],
  "lifecycle": "draft"
}