1
---
2
name: python-azure-iot-edge-modules
3
description: '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
8
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.
9
10
## When To Use
11
12
Use 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
21
Before 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
26
Minimum 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
33
If documentation cannot be fetched, proceed with explicit assumptions and flag them clearly.
34
35
## Python Official References and Best Practices (Required)
36
37
Before 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
45
Prefer 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
64
Define:
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
73
Specify:
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
82
Implement 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
91
Require:
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
100
Define:
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
109
When 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
115
Also use `references/python-official-best-practices.md` as baseline quality criteria for module design and implementation guidance.
116
117
## Required Output
118
119
Always provide:
120
121
1. Module design brief (purpose, inputs, outputs).
122
2. Deployment model (image, manifest, env settings).
123
3. Reliability and error-handling strategy.
124
4. Security and operations checklist.
125
5. Test matrix (functional, chaos, performance, rollback).
126
127
## Output Template
128
129
Use `references/python-edge-module-template.md` to structure implementation proposals and reviews.
130
131
1. Context and assumptions
132
2. Module architecture
133
3. Deployment and configuration
134
4. Reliability, security, observability
135
5. 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.
142