Skip to main content

Azure

The cipr azure command allows you to retrieve IP ranges for Azure Public cloud, sourced from the official ServiceTags JSON.

Usage

CLI command
cipr azure [flags]

Data Format

You can find data format (and filter value guidelines) of the azure command output here: Azure command data format

Flags

FlagDescriptionDefaultRequiredMultiple values
--ipv4Get only IPv4 ranges.
--ipv6Get only IPv6 ranges.
--filterFilter results using a single string. Syntax: region,service.
--filter-regionFilter results by Azure region (e.g. westeurope).
--filter-serviceFilter results by Azure system service (e.g. AzureStorage).
--listList unique values for a dimension instead of IP ranges. Valid: regions, services.

--filter cannot be combined with --filter-region or --filter-service. When neither --ipv4 nor --ipv6 is set, both are fetched. --list composes with the --filter* flags but ignores --ipv4/--ipv6. Filter values are case-insensitive.

Source resolution

By default, cipr azure fetches the Microsoft download page (https://www.microsoft.com/en-us/download/details.aspx?id=56519) with a browser User-Agent, scrapes the latest ServiceTags_Public_<date>.json URL from the page, and downloads that JSON. You can also point --source (or azure_endpoint in cipr.toml) directly at:

  • a *.json ServiceTags URL (no scrape step)
  • a local file path containing the ServiceTags JSON
  • the original Microsoft page URL (default behavior)

If Microsoft serves an anti-bot stub or changes the page layout, cipr azure returns an error suggesting you download the JSON manually and pass --source <path>, or set azure_local_file in the config.

Examples

tip

IP ranges in the 'Output' blocks might not be up to date!

Get all Azure IPv4 ranges

CLI command
cipr azure --ipv4
Output
...
13.66.143.220/30
20.42.0.0/15
20.50.32.0/19
...

Get Azure IPv6 ranges for the westeurope region with mini verbosity

CLI command
cipr azure --ipv6 --filter-region westeurope --verbose-mode mini
Output
...
2603:1020:206::/48,westeurope,AzureStorage
...

Get all Azure IP ranges for AzureStorage in westeurope with full verbosity

CLI command
cipr azure --filter westeurope,AzureStorage --verbose
Output
...
IP Prefix: 20.50.32.0/19, Region: westeurope, Service: AzureStorage
IP Prefix: 2603:1020:206::/48, Region: westeurope, Service: AzureStorage
...

List all Azure regions

CLI command
cipr azure --list regions
Output
...
eastus
westeurope
westus
...

List Azure services available in westeurope

CLI command
cipr azure --filter-region westeurope --list services
Output
...
AzureStorage
...