Self-host Presidio as a container on your own network and call it over HTTP. Call Azure AI Language PII detection, which has a first-class C# SDK and runs in Microsoft's cloud. Or write nothing but native C# rules and accept the ceiling from Chapter 5.
| Presidio sidecar | Azure AI Language | Native C# rules | |
|---|---|---|---|
| .NET access | REST via HttpClient | Official SDK | In-process |
| Where the text goes | Your network | Microsoft's cloud | Nowhere |
| Entity coverage | Broad, extensible | Broad, fixed | Checksummed identifiers only |
| Latency | ~15 ms plus a local hop | Network round trip | ~0.1 ms |
| Cross-domain F1 | ~0.48 | Not independently benchmarked here | ~0.17 |
| You operate | A container | A subscription | Nothing |
| Reversible pipeline | Built in | Redaction policies | Build it yourself |
Presidio detects and de-identifies personal data in text, images and structured data. It has four components:
One fact that most writing on this subject has not caught up with: Presidio is no longer a Microsoft project. The documentation states it is transitioning to a community-owned project, maintained by the Data Privacy Stack organisation. The old microsoft.github.io/presidio address redirects twice before landing on presidio.dataprivacystack.org. You will still find articles published this year calling it "Microsoft Presidio" and linking to a URL that no longer serves content.
This matters beyond pedantry. Your security review will ask who maintains a dependency that sees 100% of your personal data. The honest answer changed. It is not a reason to avoid Presidio, which remains actively developed, with recent releases adding country-specific recognisers and an optional country filter on the predefined set. It is a reason to treat provenance as a standing question rather than a box you ticked at adoption, which is a theme Chapter 14 returns to.
Presidio ships Python packages, Docker images, Kubernetes manifests, and REST endpoints. For any language that is not Python, REST is the route.
There is one unofficial C# client, and it deserves a paragraph rather than a chapter. Presidio.SDK by StefH is a RestEase-based client on NuGet. Version 0.0.2, published June 2025, roughly 5.6K total downloads, fourteen commits, targeting .NET 6.0 and .NET Standard 2.1. The analyzer is demonstrated; anonymizer coverage is not evidenced. A companion Presidio.SDK.Extensions package adds a handful of locale-specific pattern recognisers, at around 970 downloads.
Know it exists. Do not build on it. A component in this position, handling every piece of sensitive text in your application, should not depend on a pre-1.0 package with one maintainer and a year since its last release. The REST API is four endpoints and HttpClient is in the framework.
Download the full PDF for free?
Free download — no account required