Skip to main content

Azure

The cipr azure command retrieves IP ranges for Azure Public cloud.

Usage

CLI command
cipr azure [flags]

Data Format

See the Azure command data format for output fields and filter-value guidance.

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.

The individual filter flags accept comma-separated values. Values within one flag use OR matching, while separate filter flags use AND matching. For example, --filter-region westeurope,eastus --filter-service AzureStorage,AzureKeyVault selects either service in either region.

--filter keeps its region,service syntax and 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 and caching

The configured source key is azure, with these default settings:

azure_endpoint = "https://www.microsoft.com/en-us/download/details.aspx?id=56519"
azure_local_file = ""
azure_cache_ttl = "24h"

Use cipr configure azure to inspect the effective values.

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.

Microsoft publishes updated Service Tags files regularly. Use --no-cache when a run must fetch the current publication instead of a valid cached response.

Examples

tip

IP ranges in the output examples are snapshots and might not be current.

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 Azure Storage or Key Vault ranges in westeurope or eastus

CLI command
cipr azure --filter-region westeurope,eastus --filter-service AzureStorage,AzureKeyVault

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
...