Skip to main content

zones

Creates, updates, deletes, gets or lists a zones resource.

Overview

Namezones
TypeResource
Idazure.dns.zones

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringResource ID.
namestringResource name.
etagstringThe etag of the zone.
locationstringResource location. Required.
maxNumberOfRecordSetsintegerThe 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.
maxNumberOfRecordsPerRecordSetintegerThe 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.
nameServersarrayThe name servers for this DNS zone. This is a read-only property and any attempt to set this value will be ignored.
numberOfRecordSetsintegerThe 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.
registrationVirtualNetworksarrayA list of references to virtual networks that register hostnames in this DNS zone. This is a only when ZoneType is Private.
resolutionVirtualNetworksarrayA list of references to virtual networks that resolve records in this DNS zone. This is a only when ZoneType is Private.
tagsobjectResource tags.
typestringResource type.
zoneTypestringThe type of this DNS zone (Public or Private). Known values are: "Public" and "Private".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, zone_name, subscription_idGets a DNS zone. Retrieves the zone properties, but not the record sets within the zone.
list_by_resource_groupselectresource_group_name, subscription_id$topLists the DNS zones within a resource group.
listselectsubscription_id$topLists the DNS zones in all resource groups in a subscription.
create_or_updateinsertresource_group_name, zone_name, subscription_id, locationIf-Match, If-None-MatchCreates or updates a DNS zone. Does not modify DNS records within the zone.
updateupdateresource_group_name, zone_name, subscription_idIf-MatchUpdates a DNS zone. Does not modify DNS records within the zone.
create_or_updatereplaceresource_group_name, zone_name, subscription_id, locationIf-Match, If-None-MatchCreates or updates a DNS zone. Does not modify DNS records within the zone.
deletedeleteresource_group_name, zone_name, subscription_idIf-MatchDeletes 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.

NameDatatypeDescription
resource_group_namestringThe name of the resource group. Required.
subscription_idstring
zone_namestringThe name of the DNS zone (without a terminating dot). Required.
$topintegerThe maximum number of DNS zones to return. If not specified, returns up to 100 zones. Default value is None.
If-MatchstringThe 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-MatchstringSet 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

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
;

INSERT examples

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
;

UPDATE examples

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

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

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 }}'
;