Wednesday, February 10, 2021

Azure IP address list

Are you looking for Azure IP addresses list?

I've published simple API to get all the Azure ip address list, at all, by region or by services.

How to get the ip address list of  a specified Azure Service in a specified Azure region{regionName}/{serviceName}
It's a GET command.
You have to replace {regionname} with a valid region name and {servicename} with a valid service name.
You can get the list of valid values for {regionname} and {servicename} with the API below

How to get valid region names
It's a GET command.
Its return a list of valid region names and a special name "allregions" that you can use to get data for all regions.
If you use "allregions" with the first api above, you'll get all ip list of the specified service at all (not by region).

How to get valid service names
It's a GET command.
Its return a list of valid Azure service names.

How to get the all the ip address list of all Azure Services in a specified Azure region{regionName}
It's a GET command.
Its return a list with all Azure ip in the specified region.
If you use "allregions" as regionName, you'll get all Azure ip list. 

Where I get this data

Microsoft offer two way to find out Azure IP address list. 

One way is to download the weekly JSON file ad parse it like this example.
This file is weekly updated.
It's quite simple download it but you have to schedule the download of the file and you have to parse the file as you need.

Another way is to use "Service Tags - List" API.
To use this api you have to:
  • register Microsoft.Netowork resource provider at subscription level
  • configure a user\principal of the Azure Active Directory 
  • register an application to authenticate and grant access
  • authenticate with this user or principal to have oauth token
at this point you can use the Microsoft api:{subscriptionId}/providers/Microsoft.Network/locations/{location}/serviceTags?api-version=2020-07-01

Interesting documentations

Please Note

My API are Azure Functions hosted in a Free Plan, so after limited daily period of usage they will be unavailable.

No comments:

Post a Comment