Create objects for Azure Data-Center IP ranges - Python script

Document created by Uri Bialik Expert on Mar 26, 2017Last modified by Uri Bialik Expert on Jul 11, 2017
Version 5Show Document
  • View in full screen mode


This script generate group objects with the IP addresses of Microsoft Azure.



Download Microsoft's Azure Datacenter IP ranges from:

Run the attached Python script (the script does not have to run on the management server).

Provide the script with: the management's server IP address, username, password, the path for the downloaded file from Microsoft.

The script will now generate:

  • Over 3000 networks (for example: azure_network_104.208.0.0/19)
  • about 30 Group objects, one for each Azure region (for example: azure_region_useast)
  • and a group object called azure_region_all - a group object that contain all the group region objects.


When you get an updated file from Microsoft, you can run the tool again. When running for the second time the script will work much faster: instead of creating thousands of objects, it will only process the changes.



Download the attached zip and extract it on any machine with Python 2.7.x.




Code Version

Code version 1.0.2


Tested on version

R80, API version 1.0


NOTICE: By using this sample code you agree to terms and conditions in this Terms and Conditions


2 people found this helpful