Skip to main content

private_zones

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

Overview

Nameprivate_zones
TypeResource
Idazure.private_dns.private_zones

Fields

The following fields are returned by SELECT queries:

Success.

NameDatatypeDescription
etagstringThe ETag of the zone.
locationstringThe Azure Region where the resource lives
propertiesobjectProperties of the Private DNS zone.
tagsobjectResource tags.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresourceGroupName, privateZoneName, subscriptionIdGets a Private DNS zone. Retrieves the zone properties, but not the virtual networks links or the record sets within the zone.
list_by_resource_groupselectresourceGroupName, subscriptionId$topLists the Private DNS zones within a resource group.
listselectsubscriptionId$topLists the Private DNS zones in all resource groups in a subscription.
create_or_updateinsertresourceGroupName, privateZoneName, subscriptionIdIf-Match, If-None-MatchCreates or updates a Private DNS zone. Does not modify Links to virtual networks or DNS records within the zone.
updateupdateresourceGroupName, privateZoneName, subscriptionIdIf-MatchUpdates a Private DNS zone. Does not modify virtual network links or DNS records within the zone.
deletedeleteresourceGroupName, privateZoneName, subscriptionIdIf-MatchDeletes a Private DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. Private DNS zone cannot be deleted unless all virtual network links to it are removed.

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
privateZoneNamestringThe name of the Private DNS zone (without a terminating dot).
resourceGroupNamestringThe name of the resource group.
subscriptionIdstringGets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
$topinteger (int32)The maximum number of Private DNS zones to return. If not specified, returns up to 100 zones.
If-MatchstringThe ETag of the Private 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 Private DNS zone to be created, but to prevent updating an existing zone. Other values will be ignored.

SELECT examples

Gets a Private DNS zone. Retrieves the zone properties, but not the virtual networks links or the record sets within the zone.

SELECT
etag,
location,
properties,
tags
FROM azure.private_dns.private_zones
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND privateZoneName = '{{ privateZoneName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
;

INSERT examples

Creates or updates a Private DNS zone. Does not modify Links to virtual networks or DNS records within the zone.

INSERT INTO azure.private_dns.private_zones (
data__etag,
data__properties,
data__tags,
data__location,
resourceGroupName,
privateZoneName,
subscriptionId,
If-Match,
If-None-Match
)
SELECT
'{{ etag }}',
'{{ properties }}',
'{{ tags }}',
'{{ location }}',
'{{ resourceGroupName }}',
'{{ privateZoneName }}',
'{{ subscriptionId }}',
'{{ If-Match }}',
'{{ If-None-Match }}'
RETURNING
etag,
location,
properties,
tags
;

UPDATE examples

Updates a Private DNS zone. Does not modify virtual network links or DNS records within the zone.

UPDATE azure.private_dns.private_zones
SET
data__etag = '{{ etag }}',
data__properties = '{{ properties }}',
data__tags = '{{ tags }}',
data__location = '{{ location }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}' --required
AND privateZoneName = '{{ privateZoneName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
AND If-Match = '{{ If-Match}}'
RETURNING
etag,
location,
properties,
tags;

DELETE examples

Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. Private DNS zone cannot be deleted unless all virtual network links to it are removed.

DELETE FROM azure.private_dns.private_zones
WHERE resourceGroupName = '{{ resourceGroupName }}' --required
AND privateZoneName = '{{ privateZoneName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
AND If-Match = '{{ If-Match }}'
;