Microsoft Defender for Cloud Apps
Developer and API

Manage IP address ranges using the API

In brief

The article now provides clearer coverage of Data Enrichment API operations, Python CSV synchronization, pagination using `nextQueryFilters`, deletion behavior, and Defender for Cloud Apps support.

What Defender admins need to know

Administrators can more easily manage IP address ranges and avoid unintended deletions when enabling the script’s delete option.

Summaries are generated from the documentation change itself.

Documentation change

The comparison below shows only the changed extract. Use the full-page view for complete context.

Manage IP address ranges using the API

Manage IP address ranges with the script

Perform the following steps to use the Python script to manage IP address ranges in your tenant:

  1. Create a CSV file with the following expected fields: Name, IP_Address_Ranges, Category, Tag(id), and Override_ISP_Name.
    Here's an example of the CSV file contents:

  2. Run the script to create new records and update existing rules with the matching name.

Request body parameters

  • "data": the returned data. Will contain up to "limit" number of records each iteration. If there are more records to be pulled (hasNext=true), the last few records are dropped to ensure that all data is listed only once.
  • "hasNext": Boolean. Denotes whether another iteration on the data is needed.
  • "nextQueryFilters": If another iteration is needed, it contains the consecutive JSON query to be run. Use the "nextQueryFilters" value as the "filters" parameter in the next request.

This Python example uses the contents of a CSV file to manage (create, update, or delete) IP address ranges in your Defender for Cloud Apps environment.

For guidance on securing your Defender for Cloud Apps deployment, see Best practices for protecting your organization.

If you run into any problems, we're here to help. To get assistance or support for your product issue, please contact Defender for Cloud Apps support.