[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FD2JF1JC697EJ761RWF9W7":3,"skill-same:01M6FD2JF1JC697EJ761RWF9W7":47},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M6FD2JF1JC697EJ761RWF9W7","azure-eventhub-py",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",66,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fmicrosoft\u002Fskills\u002Fazure-eventhub-py\u002FSKILL.md",[],[18,19],"azure","azure eventhub py","2026-11-10 10:12:30",false,"# Azure Event Hubs SDK for Python\n\nBig data streaming platform for high-throughput event ingestion.\n\n## Installation\n\n```bash\npip install azure-eventhub azure-identity\n# For checkpointing with blob storage\npip install azure-eventhub-checkpointstoreblob-aio\n```\n\n## Environment Variables\n\n```bash\nEVENT_HUB_FULLY_QUALIFIED_NAMESPACE=\u003Cnamespace>.servicebus.windows.net\nEVENT_HUB_NAME=my-eventhub\nSTORAGE_ACCOUNT_URL=https:\u002F\u002F\u003Caccount>.blob.core.windows.net\nCHECKPOINT_CONTAINER=checkpoints\n```\n\n## Authentication\n\n```python\nfrom azure.identity import DefaultAzureCredential\nfrom azure.eventhub import EventHubProducerClient, EventHubConsumerClient\n\ncredential = DefaultAzureCredential()\nnamespace = \"\u003Cnamespace>.servicebus.windows.net\"\neventhub_name = \"my-eventhub\"\n\n# Producer\nproducer = EventHubProducerClient(\n    fully_qualified_namespace=namespace,\n    eventhub_name=eventhub_name,\n    credential=credential\n)\n\n# Consumer\nconsumer = EventHubConsumerClient(\n    fully_qualified_namespace=namespace,\n    eventhub_name=eventhub_name,\n    consumer_group=\"$Default\",\n    credential=credential\n)\n```\n\n## Client Types\n\n| Client | Purpose |\n|--------|---------|\n| `EventHubProducerClient` | Send events to Event Hub |\n| `EventHubConsumerClient` | Receive events from Event Hub |\n| `BlobCheckpointStore` | Track consumer progress |\n\n## Send Events\n\n```python\nfrom azure.eventhub import EventHubProducerClient, EventData\nfrom azure.identity import DefaultAzureCredential\n\nproducer = EventHubProducerClient(\n    fully_qualified_namespace=\"\u003Cnamespace>.servicebus.windows.net\",\n    eventhub_name=\"my-eventhub\",\n    credential=DefaultAzureCredential()\n)\n\nwith producer:\n    # Create batch (handles size limits)\n    event_data_batch = producer.create_batch()\n    \n    for i in range(10):\n        try:\n            event_data_batch.add(EventData(f\"Event {i}\"))\n        except ValueError:\n            # Batch is full, send and create new one\n            producer.send_batch(event_data_batch)\n            event_data_batch = producer.create_batch()\n            event_data_batch.add(EventData(f\"Event {i}\"))\n    \n    # Send remaining\n    producer.send_batch(event_data_batch)\n```\n\n### Send to Specific Partition\n\n```python\n# By partition ID\nevent_data_batch = producer.create_batch(partition_id=\"0\")\n\n# By partition key (consistent hashing)\nevent_data_batch = producer.create_batch(partition_key=\"user-123\")\n```\n\n## Receive Events\n\n### Simple Receive\n\n```python\nfrom azure.eventhub import EventHubConsumerClient\n\ndef on_event(partition_context, event):\n    print(f\"Partition: {partition_context.partition_id}\")\n    print(f\"Data: {event.body_as_str()}\")\n    partition_context.update_checkpoint(event)\n\nconsumer = EventHubConsumerClient(\n    fully_qualified_namespace=\"\u003Cnamespace>.servicebus.windows.net\",\n    eventhub_name=\"my-eventhub\",\n    consumer_group=\"$Default\",\n    credential=DefaultAzureCredential()\n)\n\nwith consumer:\n    consumer.receive(\n        on_event=on_event,\n        starting_position=\"-1\",  # Beginning of stream\n    )\n```\n\n### With Blob Checkpoint Store (Production)\n\n```python\nfrom azure.eventhub import EventHubConsumerClient\nfrom azure.eventhub.extensions.checkpointstoreblob import BlobCheckpointStore\nfrom azure.identity import DefaultAzureCredential\n\ncheckpoint_store = BlobCheckpointStore(\n    blob_account_url=\"https:\u002F\u002F\u003Caccount>.blob.core.windows.net\",\n    container_name=\"checkpoints\",\n    credential=DefaultAzureCredential()\n)\n\nconsumer = EventHubConsumerClient(\n    fully_qualified_namespace=\"\u003Cnamespace>.servicebus.windows.net\",\n    eventhub_name=\"my-eventhub\",\n    consumer_group=\"$Default\",\n    credential=DefaultAzureCredential(),\n    checkpoint_store=checkpoint_store\n)\n\ndef on_event(partition_context, event):\n    print(f\"Received: {event.body_as_str()}\")\n    # Checkpoint after processing\n    partition_context.update_checkpoint(event)\n\nwith consumer:\n    consumer.receive(on_event=on_event)\n```\n\n## Async Client\n\n```python\nfrom azure.eventhub.aio import EventHubProducerClient, EventHubConsumerClient\nfrom azure.identity.aio import DefaultAzureCredential\nimport asyncio\n\nasync def send_events():\n    credential = DefaultAzureCredential()\n    \n    async with EventHubProducerClient(\n        fully_qualified_namespace=\"\u003Cnamespace>.servicebus.windows.net\",\n        eventhub_name=\"my-eventhub\",\n        credential=credential\n    ) as producer:\n        batch = await producer.create_batch()\n        batch.add(EventData(\"Async event\"))\n        await producer.send_batch(batch)\n\nasync def receive_events():\n    async def on_event(partition_context, event):\n        print(event.body_as_str())\n        await partition_context.update_checkpoint(event)\n    \n    async with EventHubConsumerClient(\n        fully_qualified_namespace=\"\u003Cnamespace>.servicebus.windows.net\",\n        eventhub_name=\"my-eventhub\",\n        consumer_group=\"$Default\",\n        credential=DefaultAzureCredential()\n    ) as consumer:\n        await consumer.receive(on_event=on_event)\n\nasyncio.run(send_events())\n```\n\n## Event Properties\n\n```python\nevent = EventData(\"My event body\")\n\n# Set properties\nevent.properties = {\"custom_property\": \"value\"}\nevent.content_type = \"application\u002Fjson\"\n\n# Read properties (on receive)\nprint(event.body_as_str())\nprint(event.sequence_number)\nprint(event.offset)\nprint(event.enqueued_time)\nprint(event.partition_key)\n```\n\n## Get Event Hub Info\n\n```python\nwith producer:\n    info = producer.get_eventhub_properties()\n    print(f\"Name: {info['name']}\")\n    print(f\"Partitions: {info['partition_ids']}\")\n    \n    for partition_id in info['partition_ids']:\n        partition_info = producer.get_partition_properties(partition_id)\n        print(f\"Partition {partition_id}: {partition_info['last_enqueued_sequence_number']}\")\n```\n\n## Best Practices\n\n1. **Use batches** for sending multiple events\n2. **Use checkpoint store** in production for reliable processing\n3. **Use async client** for high-throughput scenarios\n4. **Use partition keys** for ordered delivery within a partition\n5. **Handle batch size limits** — catch ValueError when batch is full\n6. **Use context managers** (`with`\u002F`async with`) for proper cleanup\n7. **Set appropriate consumer groups** for different applications\n\n## Reference Files\n\n| File | Contents |\n|------|----------|\n| [references\u002Fcheckpointing.md](references\u002Fcheckpointing.md) | Checkpoint store patterns, blob checkpointing, checkpoint strategies |\n| [references\u002Fpartitions.md](references\u002Fpartitions.md) | Partition management, load balancing, starting positions |\n| [scripts\u002Fsetup_consumer.py](scripts\u002Fsetup_consumer.py) | CLI for Event Hub info, consumer setup, and event sending\u002Freceiving |\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Fmicrosoft\u002Fskills\u002Fazure-eventhub-py",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill azure-eventhub-py",{"tool":39,"command":40},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill azure-eventhub-py",{"tool":42,"command":43},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill azure-eventhub-py","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fmicrosoft\u002Fskills\u002Fazure-eventhub-py\u002FSKILL.md",true,[],[48,62,72,81,87,94],{"skillNo":49,"name":50,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":58,"publishedAt":20},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[53],{"categoryNo":54,"categoryName":55,"taxonomyType":56,"taxonomyTypeDesc":57},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[59,60,61],"model","model hierarchy","model hierarchy skill",{"skillNo":63,"name":64,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":68,"publishedAt":20},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[67],{"categoryNo":54,"categoryName":55,"taxonomyType":56,"taxonomyTypeDesc":57},[69,70,71],"MCP","zoom","zoom mcp",{"skillNo":73,"name":74,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":20},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[78,79,80,70],"sdk","zoom apps sdk","apps",{"skillNo":82,"name":83,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":20},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[83],{"skillNo":88,"name":89,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":93,"publishedAt":20},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[92],{"categoryNo":54,"categoryName":55,"taxonomyType":56,"taxonomyTypeDesc":57},[89],{"skillNo":95,"name":96,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":20},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[96]]