iotedge
Copilot instructions1.5k starsChanged 7 months agoMITView on GitHub
Azure IoT Edge is a dual-language (C# and Rust) system with three main components: Shared C# utilities live in edge-util/ (Option type, Preconditions, storage abstractions, RocksDB bindings). Solution: Microsoft.Azure.Devices.Edge.sln Test framework: xUnit with Moq. Tests use trait-based categories: [Unit], [Integration], [Bvt]. Workspace root: edgelet/Cargo.toml The api-proxy-module is a separate Rust project at edge-modules/api-proxy-module/. CI enforces both rustfmt and clippy. Run before submitting: StyleCop.Analyzers runs on Release/CheckInBuild configurations. Warnings are treated as errors (TreatWarningsAsErrors=True). CI uses Azure Pipelines (not GitHub Actions).…
Trending
Quiet since July.about the whole repository
Who's talking about Azure/iotedge
- A Hacker News story“Azure IoT Edge: Microsoft’s 60k LOC open source Rust code base”Hacker News · Jun 30, 2018 · 189 points
- A Hacker News story“Azure IoT Edge being open sourced today”Hacker News · Jun 29, 2018 · 14 points
- Azure/iot-edge-virtual-kubelet-provider“Extend createOptions length”GitHub · Apr 17, 2019 · 9 reactions
- Azure/iotedge-eflow“iotedge 1.6 LTS”GitHub · Jul 16, 2026 · 6 reactions
- Azure/meta-iotedge“Update Dunfell branch to IoT Edge version 1.2.6.”GitHub · Jan 5, 2022 · 3 reactions
The biggest 5 of 15 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 15
Talked about on GitHub and Hacker News (15 times).
On GitHub · 11
- Apr 17, 2019Extend createOptions length — Azure/iot-edge-virtual-kubelet-provider9 reactions · 3 comments
- Jul 16, 2026iotedge 1.6 LTS — Azure/iotedge-eflow6 reactions · 3 comments
- Jan 5, 2022Update Dunfell branch to IoT Edge version 1.2.6. — Azure/meta-iotedge3 reactions · 17 comments
- Mar 8, 2020Egress gateway support in k3s — k3s-io/k3s2 reactions · 8 comments
- Sep 21, 2022Direct method call prevents M2M message acknowledgement back to EdgeHub — Azure/azure-iot-sdk-csharp1 reaction · 2 comments
6 more on GitHub
- Aug 2, 2019Update to 1.0.8 — Azure/meta-iotedge1 reaction · 16 comments
- Apr 26, 2019Add arm support to winapi-rs — retep998/winapi-rs1 reaction · 9 comments
- Jan 14, 2019Update to newer upstream — warrenfalk/rocksdb-sharp1 reaction · 2 comments
- Mar 1, 2022Forward integration results in strange language metrics — inokawa/lang-box0 reactions · 4 comments
- May 15, 2021Add IoT Edge env var SendRuntimeQualityTelemetry — beatcracker/toptout0 reactions
- May 20, 2019Sort out permissions to read serial port — jantielens/serialportmodules0 reactions
On Hacker News · 4
- Jun 30, 2018Azure IoT Edge: Microsoft’s 60k LOC open source Rust code base189 points · 44 comments
- Jun 29, 2018Azure IoT Edge being open sourced today14 points
- Jul 5, 2018The IoT Edge OSS Project2 points
- Jun 27, 2018Microsoft open sources IoT edge security daemon1 point
The file
We split this copilot-instructions.md into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 35
Test framework: xUnit with Moq.
- Very specific: line 87
Async naming: All async methods must end with Async suffix (enforced by .editorconfig)
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Copilot Instructions for Azure IoT Edge
Repository Overview
Azure IoT Edge is a dual-language (C# and Rust) system with three main components:
- Edge Agent (
edge-agent/) — C# service that manages module lifecycle, deployments, and desired-state reconciliation via IoT Hub twin - Edge Hub (
edge-hub/) — C# service acting as a local gateway for MQTT, AMQP, and HTTP protocols with message routing between modules and the cloud - IoT Edge Security Daemon (
edgelet/) — Rust daemon (aziot-edged) providing workload and management APIs, module provisioning, and integration with the Azure IoT Identity Service - Edge Modules (
edge-modules/) — Standalone modules includingapi-proxy-module(Rust),metrics-collector(C#), andSimulatedTemperatureSensor(C#) - MQTT library (
mqtt/) — Rust MQTT3 client library andedgelet-clientused byapi-proxy-module
Shared C# utilities live in edge-util/ (Option type, Preconditions, storage abstractions, RocksDB bindings).
Build and Test
C# (.NET 8.0)
Solution: Microsoft.Azure.Devices.Edge.sln
# Build everything (Linux)
scripts/linux/buildBranch.sh -c Release --no-rocksdb-bin --skip-quickstart
# Run all unit tests
dotnet test --configuration Release --filter 'Category=Unit' --logger trx
# Run a single test by fully qualified name
dotnet test --filter "FullyQualifiedName~MyNamespace.MyClass.MyMethod" --logger trx --no-build
# Run integration tests (requires Azure KeyVault cert; see doc/devguide.md)
scripts/linux/runTests.sh "Category=Integration" "Release"Test framework: xUnit with Moq. Tests use trait-based categories: [Unit], [Integration], [Bvt].
Rust (toolchain 1.73)
Workspace root: edgelet/Cargo.toml
# Build the daemon and CLI
cd edgelet && cargo build -p aziot-edged -p iotedge
# Run all Rust tests
cd edgelet && cargo test --all
# Run tests for a single crate
cd edgelet && cargo test -p edgelet-core
# Run a single test by name
cd edgelet && cargo test -p edgelet-core -- test_nameThe api-proxy-module is a separate Rust project at edge-modules/api-proxy-module/.
Rust Linting
CI enforces both rustfmt and clippy. Run before submitting:
cd edgelet && cargo fmt --all -- --check
cd edgelet && cargo clippy --all && cargo clippy --all --testsC# Linting
StyleCop.Analyzers runs on Release/CheckInBuild configurations. Warnings are treated as errors (TreatWarningsAsErrors=True).
CI Pipelines
CI uses Azure Pipelines (not GitHub Actions). Separate pipelines run based on which files changed:
| Pipeline | Trigger condition | What it checks |
builds/checkin/dotnet.yaml | Changes outside edgelet/, doc/, mqtt/ | C# unit tests, 58% code coverage |
builds/checkin/edgelet.yaml | Changes in edgelet/ or builds/ | Rust build + test (amd64, arm32, arm64), rustfmt, clippy, 30% coverage |
builds/checkin/api-proxy.yaml | Changes in edge-modules/api-proxy-module/ or mqtt/edgelet-client/ | API proxy Rust build + test |
Architecture Patterns
C# Conventions
- Dependency Injection: Autofac with module registration pattern. DI modules live in
*/Service/modules/directories (e.g.,EdgeletModule.cs,RoutingModule.cs) - Custom
Option<T>type: Defined inedge-util/src/Microsoft.Azure.Devices.Edge.Util/Option.cs. Used pervasively instead of nullable references. SupportsForEachAsync,Map,OrDefault,Exists— treat it like a Rust/Scala Option Preconditionsclass: Guard methods (CheckNotNull,CheckRange, etc.) inedge-util/. All constructor parameters are validated withPreconditions.CheckNotNull(param, nameof(param))- Async naming: All async methods must end with
Asyncsuffix (enforced by.editorconfig) this.qualifier: Required for all field, property, method, and event references- Event-based logging: Domain events (e.g.,
Events.AgentCreated()) rather than direct logger calls in core logic. Uses Serilog viaMicrosoft.Extensions.Logging - Exception filtering:
catch (Exception ex) when (!ex.IsFatal())pattern for non-fatal error handling
Rust Conventions
- Lint attributes on every crate:
#![deny(rust_2018_idioms, warnings)]and#![deny(clippy::all, clippy::pedantic)]with specific#![allow(...)]exceptions - Async runtime: Tokio
- Error handling: Mix of
anyhow(in modules like api-proxy) and custom error types - API definitions: OpenAPI/Swagger YAML specs in
edgelet/api/— some Rust code is generated from these via a modifiedswagger-codegen - Cargo registry: Uses a private Azure DevOps Cargo feed (
iotedge_PublicPackages) as a mirror of crates.io, configured inedgelet/.cargo/config.toml
Docker
Both Edge Agent and Edge Hub use mcr.microsoft.com/dotnet/aspnet:8.0-alpine as base image. They bundle librocksdb.so and support multi-platform builds (amd64, arm32v7, arm64v8). Edge Hub exposes ports 1883, 8883 (MQTT), 5671 (AMQP), and 443 (HTTPS).
Key Files
netcoreappVersion.props— Sets .NET target framework and enables package lock files for all C# projectsrust-toolchain.toml— Pins the Rust toolchain versionedgelet/.cargo/config.toml— Cargo registry configuration (private feed mirror)versionInfo.json— Product version (build system replacesBUILDNUMBERandCOMMITIDplaceholders)doc/devguide.md— C# development guideedgelet/doc/devguide.md— Rust development guide (includes local daemon setup instructions)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

