zones
Creates, updates, deletes, gets or lists a zones resource.
Overview
| Name | zones |
| Type | Resource |
| Id | azure.dns.zones |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_resource_group
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Resource ID. |
name | string | Resource name. |
etag | string | The etag of the zone. |
location | string | Resource location. Required. |
maxNumberOfRecordSets | integer | The maximum number of record sets that can be created in this DNS zone. This is a read-only property and any attempt to set this value will be ignored. |
maxNumberOfRecordsPerRecordSet | integer | The maximum number of records per record set that can be created in this DNS zone. This is a read-only property and any attempt to set this value will be ignored. |
nameServers | array | The name servers for this DNS zone. This is a read-only property and any attempt to set this value will be ignored. |
numberOfRecordSets | integer | The current number of record sets in this DNS zone. This is a read-only property and any attempt to set this value will be ignored. |
registrationVirtualNetworks | array | A list of references to virtual networks that register hostnames in this DNS zone. This is a only when ZoneType is Private. |
resolutionVirtualNetworks | array | A list of references to virtual networks that resolve records in this DNS zone. This is a only when ZoneType is Private. |
tags | object | Resource tags. |
type | string | Resource type. |
zoneType | string | The type of this DNS zone (Public or Private). Known values are: "Public" and "Private". |
| Name | Datatype | Description |
|---|---|---|
id | string | Resource ID. |
name | string | Resource name. |
etag | string | The etag of the zone. |
location | string | Resource location. Required. |
maxNumberOfRecordSets | integer | The maximum number of record sets that can be created in this DNS zone. This is a read-only property and any attempt to set this value will be ignored. |
maxNumberOfRecordsPerRecordSet | integer | The maximum number of records per record set that can be created in this DNS zone. This is a read-only property and any attempt to set this value will be ignored. |
nameServers | array | The name servers for this DNS zone. This is a read-only property and any attempt to set this value will be ignored. |
numberOfRecordSets | integer | The current number of record sets in this DNS zone. This is a read-only property and any attempt to set this value will be ignored. |
registrationVirtualNetworks | array | A list of references to virtual networks that register hostnames in this DNS zone. This is a only when ZoneType is Private. |
resolutionVirtualNetworks | array | A list of references to virtual networks that resolve records in this DNS zone. This is a only when ZoneType is Private. |
tags | object | Resource tags. |
type | string | Resource type. |
zoneType | string | The type of this DNS zone (Public or Private). Known values are: "Public" and "Private". |
| Name | Datatype | Description |
|---|---|---|
id | string | Resource ID. |
name | string | Resource name. |
etag | string | The etag of the zone. |
location | string | Resource location. Required. |
maxNumberOfRecordSets | integer | The maximum number of record sets that can be created in this DNS zone. This is a read-only property and any attempt to set this value will be ignored. |
maxNumberOfRecordsPerRecordSet | integer | The maximum number of records per record set that can be created in this DNS zone. This is a read-only property and any attempt to set this value will be ignored. |
nameServers | array | The name servers for this DNS zone. This is a read-only property and any attempt to set this value will be ignored. |
numberOfRecordSets | integer | The current number of record sets in this DNS zone. This is a read-only property and any attempt to set this value will be ignored. |
registrationVirtualNetworks | array | A list of references to virtual networks that register hostnames in this DNS zone. This is a only when ZoneType is Private. |
resolutionVirtualNetworks | array | A list of references to virtual networks that resolve records in this DNS zone. This is a only when ZoneType is Private. |
tags | object | Resource tags. |
type | string | Resource type. |
zoneType | string | The type of this DNS zone (Public or Private). Known values are: "Public" and "Private". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, zone_name, subscription_id | Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. | |
list_by_resource_group | select | resource_group_name, subscription_id | $top | Lists the DNS zones within a resource group. |
list | select | subscription_id | $top | Lists the DNS zones in all resource groups in a subscription. |
create_or_update | insert | resource_group_name, zone_name, subscription_id, location | If-Match, If-None-Match | Creates or updates a DNS zone. Does not modify DNS records within the zone. |
update | update | resource_group_name, zone_name, subscription_id | If-Match | Updates a DNS zone. Does not modify DNS records within the zone. |
create_or_update | replace | resource_group_name, zone_name, subscription_id, location | If-Match, If-None-Match | Creates or updates a DNS zone. Does not modify DNS records within the zone. |
delete | delete | resource_group_name, zone_name, subscription_id | If-Match | Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
resource_group_name | string | The name of the resource group. Required. |
subscription_id | string | |
zone_name | string | The name of the DNS zone (without a terminating dot). Required. |
$top | integer | The maximum number of DNS zones to return. If not specified, returns up to 100 zones. Default value is None. |
If-Match | string | The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen etag value to prevent accidentally deleting any concurrent changes. Default value is None. |
If-None-Match | string | Set to '*' to allow a new DNS zone to be created, but to prevent updating an existing zone. Other values will be ignored. Default value is None. |
SELECT examples
- get
- list_by_resource_group
- list
Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone.
SELECT
id,
name,
etag,
location,
maxNumberOfRecordSets,
maxNumberOfRecordsPerRecordSet,
nameServers,
numberOfRecordSets,
registrationVirtualNetworks,
resolutionVirtualNetworks,
tags,
type,
zoneType
FROM azure.dns.zones
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND zone_name = '{{ zone_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Lists the DNS zones within a resource group.
SELECT
id,
name,
etag,
location,
maxNumberOfRecordSets,
maxNumberOfRecordsPerRecordSet,
nameServers,
numberOfRecordSets,
registrationVirtualNetworks,
resolutionVirtualNetworks,
tags,
type,
zoneType
FROM azure.dns.zones
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $top = '{{ $top }}'
;
Lists the DNS zones in all resource groups in a subscription.
SELECT
id,
name,
etag,
location,
maxNumberOfRecordSets,
maxNumberOfRecordsPerRecordSet,
nameServers,
numberOfRecordSets,
registrationVirtualNetworks,
resolutionVirtualNetworks,
tags,
type,
zoneType
FROM azure.dns.zones
WHERE subscription_id = '{{ subscription_id }}' -- required
AND $top = '{{ $top }}'
;
INSERT examples
- create_or_update
- Manifest
Creates or updates a DNS zone. Does not modify DNS records within the zone.
INSERT INTO azure.dns.zones (
location,
tags,
etag,
properties,
resource_group_name,
zone_name,
subscription_id,
If-Match,
If-None-Match
)
SELECT
'{{ location }}' /* required */,
'{{ tags }}',
'{{ etag }}',
'{{ properties }}',
'{{ resource_group_name }}',
'{{ zone_name }}',
'{{ subscription_id }}',
'{{ If-Match }}',
'{{ If-None-Match }}'
RETURNING
id,
name,
etag,
location,
properties,
tags,
type
;
# Description fields are for documentation purposes
- name: zones
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the zones resource.
- name: zone_name
value: "{{ zone_name }}"
description: Required parameter for the zones resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the zones resource.
- name: location
value: "{{ location }}"
description: |
Resource location. Required.
- name: tags
value: "{{ tags }}"
description: |
Resource tags.
- name: etag
value: "{{ etag }}"
description: |
The etag of the zone.
- name: properties
value:
zoneType: "{{ zoneType }}"
registrationVirtualNetworks:
- id: "{{ id }}"
resolutionVirtualNetworks:
- id: "{{ id }}"
- name: If-Match
value: "{{ If-Match }}"
description: The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes. Default value is None.
description: The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the last-seen etag value to prevent accidentally overwriting any concurrent changes. Default value is None.
- name: If-None-Match
value: "{{ If-None-Match }}"
description: Set to '*' to allow a new DNS zone to be created, but to prevent updating an existing zone. Other values will be ignored. Default value is None.
description: Set to '*' to allow a new DNS zone to be created, but to prevent updating an existing zone. Other values will be ignored. Default value is None.
UPDATE examples
- update
Updates a DNS zone. Does not modify DNS records within the zone.
UPDATE azure.dns.zones
SET
tags = '{{ tags }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND zone_name = '{{ zone_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND If-Match = '{{ If-Match}}'
RETURNING
id,
name,
etag,
location,
properties,
tags,
type;
REPLACE examples
- create_or_update
Creates or updates a DNS zone. Does not modify DNS records within the zone.
REPLACE azure.dns.zones
SET
location = '{{ location }}',
tags = '{{ tags }}',
etag = '{{ etag }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND zone_name = '{{ zone_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND location = '{{ location }}' --required
AND If-Match = '{{ If-Match}}'
AND If-None-Match = '{{ If-None-Match}}'
RETURNING
id,
name,
etag,
location,
properties,
tags,
type;
DELETE examples
- delete
Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone.
DELETE FROM azure.dns.zones
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND zone_name = '{{ zone_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND If-Match = '{{ If-Match }}'
;