azure-eventgrid-py

azure-eventgrid-py is a skill for Claude Code, Codex from microsoft/skills. It costs 52 tokens per session (1,653 once invoked), scanned A, original, MIT.

A Python SDK for Azure Event Grid, a service that routes notifications between applications. It supports CloudEvents, a standard format for describing events.

In plain words
What is it for?
Use it to publish events, handle CloudEvents, and connect applications in event-driven systems.
Why use it?
It removes the need to implement your own event publishing and delivery connection between services.

Skill for Claude CodeCodex

Part of the azure-sdk-python plugin — 40 skills shipped together

About the project

microsoft/skills is a collection of skills, custom agents, AGENTS.md templates, plugins, hooks, commands, and MCP configurations that give AI coding agents context for Azure SDK and Microsoft AI Foundry development. Developers use it to install selected domain-specific guidance into coding-agent environments. The catalogue entries are the repository’s own agent resources and supporting configurations.

microsoft/skills · 2,992 stars · on GitHub · microsoft.github.io

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/microsoft/skills/azure-eventgrid-py
Any agent
npx skills add microsoft/skills --skill azure-eventgrid-py
Clone the repo
git clone --depth 1 https://github.com/microsoft/skills

Made for: Claude Code, Codex.

Or install azure-sdk-python, the plugin that ships this one along with the rest of its 40 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for azure-eventgrid-py

README.md
[![agentmods](https://agentmods.dev/badge/skills/microsoft/skills/azure-eventgrid-py.svg)](https://agentmods.dev/skills/microsoft/skills/azure-eventgrid-py)
Your own site
<a href="https://agentmods.dev/skills/microsoft/skills/azure-eventgrid-py"><img src="https://agentmods.dev/badge/skills/microsoft/skills/azure-eventgrid-py.svg" alt="Measured on agentmods" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,653 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00052 $0.01653
Opus 5 $0.00026 $0.00826
Sonnet 5 $0.00010 $0.00331
Haiku 4.5 $0.00005 $0.00165

Measured 2d ago against content hash 9c216f291553, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

azure-eventgrid-py scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/plugins/azure-sdk-python/skills/azure-eventgrid-py/SKILL.md · 203 lines

How it starts

The opening of the file, as written. The whole thing — 203 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Azure Event Grid SDK for Python

Event routing service for building event-driven applications with pub/sub semantics.

Installation

pip install azure-eventgrid azure-identity

Environment Variables

EVENTGRID_TOPIC_ENDPOINT=https://<topic-name>.<region>.eventgrid.azure.net/api/events  # Required for Event Grid topic publishing
EVENTGRID_NAMESPACE_ENDPOINT=https://<namespace>.<region>.eventgrid.azure.net  # Required for namespace operations
AZURE_TOKEN_CREDENTIALS=prod # Required only if DefaultAzureCredential is used in production

Authentication & Lifecycle

🔑 Two rules apply to every code sample below:

  1. Prefer DefaultAzureCredential. It works locally (Azure CLI / VS Code / Developer CLI) and in Azure (managed identity, workload identity) with no code change. Avoid connection strings, account/API keys — they bypass Entra audit and rotation.
    • Local dev: DefaultAzureCredential works as-is.
    • Production: set AZURE_TOKEN_CREDENTIALS=prod (or AZURE_TOKEN_CREDENTIALS=<specific_credential>) to constrain the credential chain to production-safe credentials.
  2. Wrap every client in a context manager so HTTP transports, sockets, and token caches are released deterministically:
    • Sync: with <Client>(...) as client:
    • Async: async with <Client>(...) as client: and async with DefaultAzureCredential() as credential: (from azure.identity.aio)

Snippets may abbreviate this setup, but production code should always follow both rules.

import os
from azure.identity import DefaultAzureCredential, ManagedIdentityCredential
from azure.eventgrid import EventGridPublisherClient

# Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=<specific_credential>
credential = DefaultAzureCredential(require_envvar=True)
# Or use a specific credential directly in production:
# See https://learn.microsoft.com/python/api/overview/azure/identity-readme?view=azure-python#credential-classes
# credential = ManagedIdentityCredential()

endpoint = "https://<topic-name>.<region>.eventgrid.azure.net/api/events"

with EventGridPublisherClient(endpoint, credential) as client:
    # Use client here (see following sections for operations)
    ...

Read the full file on GitHub · 203 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 203 lines · 52 tokens per session scan A 9c216f291553

Subscribe to this mod's changes

azure-eventgrid-py is a skill published in the GitHub repository microsoft/skills (2,992 stars, last pushed yesterday), licensed MIT. It adds 52 tokens to every session and 1,653 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

agents-v2-py-v2

Azure AI Hosted Agents (Python) workflow skill. Use this skill when the user needs Build container-based Foundry Agents with Azure AI Projects SDK (ImageBasedHostedAgentDefinition). Use when creating hosted agents with custom container images in Azure AI Foundry and the operator should preserve the upstream workflow…

diegosouzapw/awesome-omni-skills · 78 tokens

agents-v2-py

Azure AI Hosted Agents (Python) workflow skill. Use this skill when the user needs Build container-based Foundry Agents with Azure AI Projects SDK (ImageBasedHostedAgentDefinition). Use when creating hosted agents with custom container images in Azure AI Foundry and the operator should preserve the upstream workflow…

diegosouzapw/awesome-omni-skills · 76 tokens

agents-sdk-dotnet-activityhandler-migration

Use when migrating a Microsoft 365 Agents SDK agent that uses ActivityHandler or TeamsActivityHandler to AgentApplication. This is ONLY for DotNet projects that uses Microsoft.Agents. packages. Triggered by Agents SDK bots that subclass ActivityHandler or TeamsActivityHandler that need to be modernized to…

microsoft/Agents · 76 tokens

agents-sdk-python-otel

Use when adding, configuring, validating, or troubleshooting OpenTelemetry observability for a Microsoft 365 Agents SDK application in Python. Trigger when the user mentions OpenTelemetry, OTel, telemetry, traces, metrics, logs, OTLP, Aspire Dashboard, Application Insights, Azure Monitor, distributed tracing, custom…

microsoft/Agents · 81 tokens

agents-sdk-provision

Use when provisioning Azure resources for a Microsoft Agents SDK application — including creating an Azure Bot Service resource, setting up Entra app registrations, configuring identity credentials (UserManagedIdentity, FederatedCredentials, or ClientSecret), adding a Teams channel, running Bicep deployments for SSO…

microsoft/Agents · 131 tokens

bf-to-agents-sdk-typescript-migration

Assess and migrate JavaScript or TypeScript bots from BotBuilder/Bot Framework SDK to Microsoft 365 Agents SDK with AgentApplication. Use to produce a migration report and plan before editing code, map BotBuilder packages and APIs, identify unsupported features, and implement only the supported plan items selected by…

microsoft/Agents · 71 tokens