Skip to main content

record_sets

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

Overview

Namerecord_sets
TypeResource
Idazure.dns.record_sets

Fields

The following fields are returned by SELECT queries:

Success.

NameDatatypeDescription
idstringThe ID of the record set.
namestringThe name of the record set.
etagstringThe etag of the record set.
propertiesobjectThe properties of the record set.
typestringThe type of the record set.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresourceGroupName, zoneName, relativeRecordSetName, recordType, subscriptionIdGets a record set.
list_by_typeselectresourceGroupName, zoneName, recordType, subscriptionId$top, $recordsetnamesuffixLists the record sets of a specified type in a DNS zone.
list_by_dns_zoneselectresourceGroupName, zoneName, subscriptionId$top, $recordsetnamesuffixLists all record sets in a DNS zone.
create_or_updateinsertresourceGroupName, zoneName, relativeRecordSetName, recordType, subscriptionIdIf-Match, If-None-MatchCreates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).
updateupdateresourceGroupName, zoneName, relativeRecordSetName, recordType, subscriptionIdIf-MatchUpdates a record set within a DNS zone.
deletedeleteresourceGroupName, zoneName, relativeRecordSetName, recordType, subscriptionIdIf-MatchDeletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).

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
recordTypestringThe type of DNS record in this record set.
relativeRecordSetNamestringThe name of the record set, relative to the name of the zone.
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).
$recordsetnamesuffixstringThe suffix label of the record set name that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with .<recordSetNameSuffix>
$topinteger (int32)The maximum number of record sets to return. If not specified, returns up to 100 record sets.
If-MatchstringThe etag of the record set. Omit this value to always delete the current record set. Specify the last-seen etag value to prevent accidentally deleting any concurrent changes.
If-None-MatchstringSet to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will be ignored.

SELECT examples

Gets a record set.

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

INSERT examples

Creates or updates a record set within a DNS zone. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created).

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

UPDATE examples

Updates a record set within a DNS zone.

UPDATE azure.dns.record_sets
SET
data__etag = '{{ etag }}',
data__properties = '{{ properties }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}' --required
AND zoneName = '{{ zoneName }}' --required
AND relativeRecordSetName = '{{ relativeRecordSetName }}' --required
AND recordType = '{{ recordType }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
AND If-Match = '{{ If-Match}}'
RETURNING
id,
name,
etag,
properties,
type;

DELETE examples

Deletes a record set from a DNS zone. This operation cannot be undone. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).

DELETE FROM azure.dns.record_sets
WHERE resourceGroupName = '{{ resourceGroupName }}' --required
AND zoneName = '{{ zoneName }}' --required
AND relativeRecordSetName = '{{ relativeRecordSetName }}' --required
AND recordType = '{{ recordType }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
AND If-Match = '{{ If-Match }}'
;