A Python utility to maintain a local database of Microsoft Azure Service Tag IP prefixes and ASNs, and to quickly verify whether an IP address is routed through Microsoft’s infrastructure (e.g. Azure proxies).
- Automated Updates
Downloads the official Microsoft “Azure IP Ranges & Service Tags” JSON once a week (or on demand) and rebuilds a local SQLite database. - Trusted Lists
- Service Tags: stores every tag name and its IP prefixes (
tags(tag, prefix)table). - ASNs: derives and stores the Autonomous System Numbers behind each prefix (
asns(asn)table).
- Service Tags: stores every tag name and its IP prefixes (
- CSV Exports
microsoft_trusted_prefixes.csv(columns:tag,prefix)microsoft_asns.csv(column:asn)
- IP Check CLI
Command-line flag to check one or more IP addresses and report if they’re “Trusted” or “Untrusted,” with matching prefix/ASN details.
- Install/Clone the repository:
git clone https://github.com/REALSDEALS/pyMCProxyCheck.git
cd pyMCProxyCheck- Install dependencies:
pip install -r requirements.txt- Run the script:
python microsoft_proxies.py- Build database of IP addresses:
python microsoft_proxies.py --update- Check IP addresses:
python microsoft_proxies.py --check-ip <ip_address1> <ip_address2> ...python microsoft_proxies.py --check-ip 1.1.1.1 Trusted or Untrusted
To export the trusted prefixes and ASNs to CSV files, run:
python microsoft_proxies.py --exportmicrosoft_trusted_prefixes.csv: Contains all trusted prefixes with their associated tags.microsoft_asns.csv: Contains all ASNs derived from the prefixes.
This project is licensed under the MIT License. See the LICENSE file for details.
© 2025 REALSDEALS
You are free to use, modify, and distribute this software, provided that the original license and copyright notice are included in all copies or substantial portions of the software.