A drop in replacement for the retired Azure Anomaly Detector service, powered by PyOD.
Project description
azure-anomaly-shim
A drop in replacement for the retired Azure Anomaly Detector service, powered by PyOD.
Microsoft is retiring Azure AI Anomaly Detector on 1 October 2026. Any application built on that service will stop working. This small Python package lets you keep your existing code almost unchanged. Swap one import line and your anomaly detection runs locally using the open source PyOD library instead of the Azure service.
Why this exists
Many production systems built on Azure Anomaly Detector are facing a forced migration. Microsoft recommends moving to Microsoft Fabric, which is a heavier solution that requires more changes. This package offers a lighter alternative for users who only need the core anomaly detection feature.
Installation
pip install azure-anomaly-shim
Quick start
If your code currently looks like this:
from azure.ai.anomalydetector import AnomalyDetectorClient
client = AnomalyDetectorClient(endpoint, credential)
result = client.detect_univariate_entire_series(request)
You can switch to this:
from azure_anomaly_shim.detector import detect_univariate_entire_series
result = detect_univariate_entire_series(series=[10, 11, 9, 50, 10, 11], sensitivity=95)
No API keys. No network calls. No subscription. Runs locally.
What is supported
Two functions are currently available:
detect_univariate_entire_series(series, sensitivity=95)
Analyzes an entire time series and flags every point that looks anomalous.
detect_univariate_last_point(series, sensitivity=95)
Analyzes a time series and returns whether only the most recent point is anomalous. Useful for live monitoring.
Both return results in the same shape the old Azure SDK returned.
Example output
from azure_anomaly_shim.detector import detect_univariate_entire_series
data = [10, 11, 9, 10, 12, 9, 11, 10, 50, 10, 11]
result = detect_univariate_entire_series(data, sensitivity=85)
for i, is_anomaly in enumerate(result["is_anomaly"]):
if is_anomaly:
print(f"Position {i}: value = {data[i]}, severity = {result['severity'][i]:.2f}")
Output: Position 8: value = 50, severity = 1.00
What is not supported yet
Multivariate detection. The old SDK had train_multivariate_model and detect_multivariate_batch_anomaly for analyzing multiple correlated signals at once. These are planned for a future release.
Streaming windowed detection. Currently the package re analyzes the full series each call. For very long histories this is slower than the original Azure service. A windowed approach is on the roadmap.
How it works under the hood
The package uses Isolation Forest from the PyOD library. Isolation Forest works by randomly partitioning the data and counting how quickly each point can be isolated. Outliers get isolated faster than normal points, which makes them easy to spot.
The sensitivity parameter controls how strict the detection is. Higher values flag fewer anomalies, lower values flag more. The default is 95, which flags the top 5 percent of unusual points.
License
MIT License. Free to use in commercial and personal projects.
Author
Built by Sibonile Mthunzi as part of learning cloud migration tooling. Contributions and bug reports welcome.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file azure_anomaly_shim-0.1.0.tar.gz.
File metadata
- Download URL: azure_anomaly_shim-0.1.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97ac2d9798b632e1622a78ff0fff7e767b0f18062d71a6ff7d91249fb9a7e17c
|
|
| MD5 |
1956540979fab3ddc1fc1f9a26ab48a9
|
|
| BLAKE2b-256 |
f660b8af1ca11f154cb7028926ac9970c7758c6e89b8a8136055e517dda39260
|
File details
Details for the file azure_anomaly_shim-0.1.0-py3-none-any.whl.
File metadata
- Download URL: azure_anomaly_shim-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f51d8af0f5e6f46723849dacd2f1fc9b661a69337c29ee6f1489cd566570df3
|
|
| MD5 |
52bce12249cadcf9f49b976106475ae5
|
|
| BLAKE2b-256 |
2fa99393242dc6a839ad9d8f13c7c6783acc0881feb94a2b03ad603d6e9ffdba
|