Namespace: microsoft.graph.security
Important
APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Get a list of the zone objects and their properties.
Permissions
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
| Permission type | Least privileged permissions | Higher privileged permissions |
|---|---|---|
| Delegated (work or school account) | Zone.Read.All | Zone.ReadWrite.All |
| Delegated (personal Microsoft account) | Not supported. | Not supported. |
| Application | Zone.Read.All | Zone.ReadWrite.All |
Important
In delegated scenarios with work or school accounts, the signed-in user must be assigned a supported Microsoft Entra role or a custom role with a supported role permission. The following least privileged roles are supported for this operation.
- Security Administrator
- Global Reader
- Security Reader
HTTP request
GET /security/zones
Optional query parameters
This method supports the $select, $filter, $count, $orderby, $top, $skip, and $expand OData query parameters to help customize the response. For general information, see OData query parameters. The default and maximum page sizes are 1000 zones objects.
The following table lists the $filter and $orderby query support for each property.
| Property | $filter operators | $orderby |
|---|---|---|
| created/dateTime | ge, le, gt, lt |
✓ |
| description | eq, contains |
|
| displayName | eq, contains |
✓ |
| id | eq |
|
| modified/dateTime | ge, le, gt, lt |
✓ |
| aggregations/kind | eq (within any() expression) |
|
| aggregations/count | gt, lt, ge, le (within any() expression) |
The following table shows example query patterns.
| Query pattern | Example |
|---|---|
| Filter by display name | $filter=displayName eq 'Production Zone' |
| Filter by description contains | $filter=contains(description, 'production') |
| Filter by creation date | $filter=created/dateTime ge 2023-01-01T00:00:00Z |
| Filter by environment type | $filter=aggregations/any(a: a/kind eq 'azureSubscription') |
| Filter by environment count | $filter=aggregations/any(a: a/kind eq 'azureSubscription' and a/count gt 5) |
| Order by display name | $orderby=displayName asc |
| Order by creation date descending | $orderby=created/dateTime desc |
| Pagination | $top=10&$skip=20&$count=true |
| Select specific fields | $select=id,displayName,aggregations |
| Expand environments | $expand=environments |
Request headers
| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
Request body
Don't supply a request body for this method.
Response
If successful, this method returns a 200 OK response code and a collection of microsoft.graph.security.zone objects in the response body.
Examples
Request
The following example shows a request.
GET https://graph.microsoft.com/beta/security/zones
Response
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/security/$metadata#zones",
"value": [
{
"@odata.type": "#microsoft.graph.security.zone",
"id": "05cfec937c214892a14448562ef4bf4a",
"displayName": "Production Zone",
"description": "Zone for production environments",
"created": {
"by": "Yarin",
"dateTime": "2023-10-01T12:00:00Z"
},
"modified": {
"by": "Yarin",
"dateTime": "2023-10-01T12:00:00Z"
},
"aggregations": [
{
"kind": "azureSubscription",
"count": 1
},
{
"kind": "awsAccount",
"count": 2
},
{
"kind": "gcpProject",
"count": 1
}
]
},
{
"@odata.type": "#microsoft.graph.security.zone",
"id": "95b3220fe91548eaae9e812b30bbd735",
"displayName": "Development Zone",
"description": "Zone for development environments",
"created": {
"by": "Yarin",
"dateTime": "2023-10-01T12:00:00Z"
},
"modified": {
"by": "Yarin",
"dateTime": "2023-10-01T12:00:00Z"
},
"aggregations": [
{
"kind": "awsAccount",
"count": 1
}
]
}
]
}