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:

Success.

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
namestringThe name of the resource
etagstringThe etag of the zone.
propertiesobjectThe properties of the zone.
systemDataobjectMetadata pertaining to creation and last modification of the resource.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresourceGroupName, zoneName, subscriptionIdGets a DNS zone. Retrieves the zone properties, but not the record sets within the zone.
list_by_resource_groupselectresourceGroupName, subscriptionId$topLists the DNS zones within a resource group.
listselectsubscriptionId$topLists the DNS zones in all resource groups in a subscription.
create_or_updateinsertresourceGroupName, zoneName, subscriptionIdIf-Match, If-None-MatchCreates or updates a DNS zone. Does not modify DNS records within the zone.
updateupdateresourceGroupName, zoneName, subscriptionIdIf-MatchUpdates a DNS zone. Does not modify DNS records within the zone.
deletedeleteresourceGroupName, zoneName, subscriptionIdIf-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
resourceGroupNamestringThe name of the resource group. The name is case insensitive.
subscriptionIdstringThe ID of the target subscription.
zoneNamestringThe name of the DNS zone (without a terminating dot).
$topinteger (int32)The maximum number of DNS zones to return. If not specified, returns up to 100 zones.
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.
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.

SELECT examples

Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone.

SELECT
id,
name,
etag,
properties,
systemData,
type
FROM azure.dns.zones
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND zoneName = '{{ zoneName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
;

INSERT examples

Creates or updates a DNS zone. Does not modify DNS records within the zone.

INSERT INTO azure.dns.zones (
data__etag,
data__properties,
resourceGroupName,
zoneName,
subscriptionId,
If-Match,
If-None-Match
)
SELECT
'{{ etag }}',
'{{ properties }}',
'{{ resourceGroupName }}',
'{{ zoneName }}',
'{{ subscriptionId }}',
'{{ If-Match }}',
'{{ If-None-Match }}'
RETURNING
id,
name,
etag,
properties,
systemData,
type
;

UPDATE examples

Updates a DNS zone. Does not modify DNS records within the zone.

UPDATE azure.dns.zones
SET
data__tags = '{{ tags }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}' --required
AND zoneName = '{{ zoneName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
AND If-Match = '{{ If-Match}}'
RETURNING
id,
name,
etag,
properties,
systemData,
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 resourceGroupName = '{{ resourceGroupName }}' --required
AND zoneName = '{{ zoneName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
AND If-Match = '{{ If-Match }}'
;