Python Azure IoT Edge Modules
Use this skill to design, implement, and validate Python-based IoT Edge modules for telemetry processing, local inference, protocol translation, and edge-to-cloud integration.
When To Use
Use this skill for requests like:
- "quiero crear un modulo Python para IoT Edge"
- "como despliego modulos edge con manifest"
- "necesito filtrar/agregar telemetria antes de subirla"
- "como manejo desconexiones y reintentos en edge"
Mandatory Docs Review
Before recommending runtime behavior or deployment decisions, review:
Minimum checks:
- Runtime architecture and module lifecycle.
- Supported host OS and versions.
- Deployment model and configuration flow.
- Current release/version guidance.
If documentation cannot be fetched, proceed with explicit assumptions and flag them clearly.
Python Official References and Best Practices (Required)
Before proposing Python implementation details, consult official Python sources:
Prefer official docs over community snippets unless there is a specific compatibility reason to deviate.
Goals
- Deliver module architecture and implementation plan that is production-focused.
- Ensure reliable edge messaging under network variability.
- Provide deployment, observability, and validation artifacts.
Module Use Cases
- Protocol adapter (serial/Modbus/OPC-UA to IoT message format).
- Telemetry enrichment and normalization.
- Local anomaly detection or inference.
- Command orchestration and local actuator control.
Delivery Workflow
1) Contract and Interfaces
Define:
- Module inputs and outputs.
- Message schema and versioning policy.
- Routes and priorities for normal vs critical telemetry.
- Desired properties used for dynamic configuration.
2) Runtime and Packaging
Specify:
- Python runtime version target.
- Container image strategy (base image, slim footprint, CVE hygiene).
- Resource profile (CPU/memory bounds).
- Startup and health checks.
3) Reliability Design
Implement and validate:
- Retries with exponential backoff and jitter.
- Graceful degradation on upstream failures.
- Local queueing strategy where needed.
- Idempotent processing for replayed messages.
4) Security Controls
Require:
- No plaintext secrets in code or manifest.
- Least-privilege module behavior.
- Secure transport and trusted cert chain handling.
- Traceability for command handling and state changes.
5) Deployment and Operations
Define:
- Environment-specific deployment manifests.
- Rollout strategy (pilot, staged, broad).
- Rollback criteria.
- SLOs and alerting conditions.
Reuse Other Skills
When relevant, combine with:
azure-smart-city-iot-solution-builder for platform-level architecture.
appinsights-instrumentation for telemetry instrumentation approaches.
azure-resource-visualizer for architecture diagrams and dependency mapping.
Also use references/python-official-best-practices.md as baseline quality criteria for module design and implementation guidance.
Required Output
Always provide:
- Module design brief (purpose, inputs, outputs).
- Deployment model (image, manifest, env settings).
- Reliability and error-handling strategy.
- Security and operations checklist.
- Test matrix (functional, chaos, performance, rollback).
Output Template
Use references/python-edge-module-template.md to structure implementation proposals and reviews.
- Context and assumptions
- Module architecture
- Deployment and configuration
- Reliability, security, observability
- Validation and rollout plan
Guardrails
- Do not recommend direct production rollout without pilot stage.
- Do not embed secrets in Dockerfiles, source, or manifests.
- Do not omit health probes, restart behavior, and rollback criteria.
1---2name: python-azure-iot-edge-modules3description: Build and operate Python Azure IoT Edge modules with robust messaging, deployment manifests, observability, and production readiness checks.4---5
6# Python Azure IoT Edge Modules
7
8Use this skill to design, implement, and validate Python-based IoT Edge modules for telemetry processing, local inference, protocol translation, and edge-to-cloud integration.
9
10## When To Use
11
12Use this skill for requests like:
13
14- "quiero crear un modulo Python para IoT Edge"
15- "como despliego modulos edge con manifest"
16- "necesito filtrar/agregar telemetria antes de subirla"
17- "como manejo desconexiones y reintentos en edge"
18
19## Mandatory Docs Review
20
21Before recommending runtime behavior or deployment decisions, review:
22
23- https://learn.microsoft.com/azure/iot-edge/
24- https://learn.microsoft.com/es-es/azure/iot-edge/
25
26Minimum checks:
27
28- Runtime architecture and module lifecycle.
29- Supported host OS and versions.
30- Deployment model and configuration flow.
31- Current release/version guidance.
32
33If documentation cannot be fetched, proceed with explicit assumptions and flag them clearly.
34
35## Python Official References and Best Practices (Required)
36
37Before proposing Python implementation details, consult official Python sources:
38
39- https://www.python.org/
40- https://docs.python.org/3/
41- https://docs.python.org/3/reference/
42- https://docs.python.org/3/library/
43- references/python-official-best-practices.md
44
45Prefer official docs over community snippets unless there is a specific compatibility reason to deviate.
46
47## Goals
48
49- Deliver module architecture and implementation plan that is production-focused.
50- Ensure reliable edge messaging under network variability.
51- Provide deployment, observability, and validation artifacts.
52
53## Module Use Cases
54
55- Protocol adapter (serial/Modbus/OPC-UA to IoT message format).
56- Telemetry enrichment and normalization.
57- Local anomaly detection or inference.
58- Command orchestration and local actuator control.
59
60## Delivery Workflow
61
62### 1) Contract and Interfaces
63
64Define:
65
66- Module inputs and outputs.
67- Message schema and versioning policy.
68- Routes and priorities for normal vs critical telemetry.
69- Desired properties used for dynamic configuration.
70
71### 2) Runtime and Packaging
72
73Specify:
74
75- Python runtime version target.
76- Container image strategy (base image, slim footprint, CVE hygiene).
77- Resource profile (CPU/memory bounds).
78- Startup and health checks.
79
80### 3) Reliability Design
81
82Implement and validate:
83
84- Retries with exponential backoff and jitter.
85- Graceful degradation on upstream failures.
86- Local queueing strategy where needed.
87- Idempotent processing for replayed messages.
88
89### 4) Security Controls
90
91Require:
92
93- No plaintext secrets in code or manifest.
94- Least-privilege module behavior.
95- Secure transport and trusted cert chain handling.
96- Traceability for command handling and state changes.
97
98### 5) Deployment and Operations
99
100Define:
101
102- Environment-specific deployment manifests.
103- Rollout strategy (pilot, staged, broad).
104- Rollback criteria.
105- SLOs and alerting conditions.
106
107## Reuse Other Skills
108
109When relevant, combine with:
110
111- `azure-smart-city-iot-solution-builder` for platform-level architecture.
112- `appinsights-instrumentation` for telemetry instrumentation approaches.
113- `azure-resource-visualizer` for architecture diagrams and dependency mapping.
114
115Also use `references/python-official-best-practices.md` as baseline quality criteria for module design and implementation guidance.
116
117## Required Output
118
119Always provide:
120
1211. Module design brief (purpose, inputs, outputs).
1222. Deployment model (image, manifest, env settings).
1233. Reliability and error-handling strategy.
1244. Security and operations checklist.
1255. Test matrix (functional, chaos, performance, rollback).
126
127## Output Template
128
129Use `references/python-edge-module-template.md` to structure implementation proposals and reviews.
130
1311. Context and assumptions
1322. Module architecture
1333. Deployment and configuration
1344. Reliability, security, observability
1355. Validation and rollout plan
136
137## Guardrails
138
139- Do not recommend direct production rollout without pilot stage.
140- Do not embed secrets in Dockerfiles, source, or manifests.
141- Do not omit health probes, restart behavior, and rollback criteria.