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:

NameDatatypeDescription
idstringFully qualified resource Id for the resource. Example - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateDnsZoneName}'. # pylint: disable=line-too-long
namestringThe name of the resource.
etagstringThe ETag of the zone.
internalIdstringPrivate zone internal Id.
locationstringThe Azure Region where the resource lives.
maxNumberOfRecordSetsintegerThe maximum number of record sets that can be created in this Private DNS zone. This is a read-only property and any attempt to set this value will be ignored.
maxNumberOfVirtualNetworkLinksintegerThe maximum number of virtual networks that can be linked to this Private DNS zone. This is a read-only property and any attempt to set this value will be ignored.
maxNumberOfVirtualNetworkLinksWithRegistrationintegerThe maximum number of virtual networks that can be linked to this Private DNS zone with registration enabled. This is a read-only property and any attempt to set this value will be ignored.
numberOfRecordSetsintegerThe current number of record sets in this Private DNS zone. This is a read-only property and any attempt to set this value will be ignored.
numberOfVirtualNetworkLinksintegerThe current number of virtual networks that are linked to this Private DNS zone. This is a read-only property and any attempt to set this value will be ignored.
numberOfVirtualNetworkLinksWithRegistrationintegerThe current number of virtual networks that are linked to this Private DNS zone with registration enabled. This is a read-only property and any attempt to set this value will be ignored.
provisioningStatestringThe provisioning state of the resource. This is a read-only property and any attempt to set this value will be ignored. Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and "Canceled".
tagsobjectResource tags.
typestringThe type of the resource. Example - 'Microsoft.Network/privateDnsZones'.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, private_zone_name, subscription_idGets a Private DNS zone. Retrieves the zone properties, but not the virtual networks links or the record sets within the zone.
list_by_resource_groupselectresource_group_name, subscription_id$topLists the Private DNS zones within a resource group.
listselectsubscription_id$topLists the Private DNS zones in all resource groups in a subscription.
create_or_updateinsertresource_group_name, private_zone_name, subscription_idIf-Match, If-None-MatchCreates or updates a Private DNS zone. Does not modify Links to virtual networks or DNS records within the zone.
updateupdateresource_group_name, private_zone_name, subscription_idIf-MatchUpdates a Private DNS zone. Does not modify virtual network links or DNS records within the zone.
create_or_updatereplaceresource_group_name, private_zone_name, subscription_idIf-Match, If-None-MatchCreates or updates a Private DNS zone. Does not modify Links to virtual networks or DNS records within the zone.
deletedeleteresource_group_name, private_zone_name, subscription_idIf-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
private_zone_namestringThe name of the Private DNS zone (without a terminating dot). Required.
resource_group_namestringThe name of the resource group. Required.
subscription_idstring
$topintegerThe maximum number of Private DNS zones to return. If not specified, returns up to 100 zones. Default value is None.
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. Default value is None.
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. Default value is None.

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
id,
name,
etag,
internalId,
location,
maxNumberOfRecordSets,
maxNumberOfVirtualNetworkLinks,
maxNumberOfVirtualNetworkLinksWithRegistration,
numberOfRecordSets,
numberOfVirtualNetworkLinks,
numberOfVirtualNetworkLinksWithRegistration,
provisioningState,
tags,
type
FROM azure.private_dns.private_zones
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND private_zone_name = '{{ private_zone_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- 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 (
tags,
location,
etag,
resource_group_name,
private_zone_name,
subscription_id,
If-Match,
If-None-Match
)
SELECT
'{{ tags }}',
'{{ location }}',
'{{ etag }}',
'{{ resource_group_name }}',
'{{ private_zone_name }}',
'{{ subscription_id }}',
'{{ If-Match }}',
'{{ If-None-Match }}'
RETURNING
id,
name,
etag,
location,
properties,
tags,
type
;

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
tags = '{{ tags }}',
location = '{{ location }}',
etag = '{{ etag }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND private_zone_name = '{{ private_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 Private DNS zone. Does not modify Links to virtual networks or DNS records within the zone.

REPLACE azure.private_dns.private_zones
SET
tags = '{{ tags }}',
location = '{{ location }}',
etag = '{{ etag }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND private_zone_name = '{{ private_zone_name }}' --required
AND subscription_id = '{{ subscription_id }}' --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 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 resource_group_name = '{{ resource_group_name }}' --required
AND private_zone_name = '{{ private_zone_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND If-Match = '{{ If-Match }}'
;