Bicep resource definition
The dnsZones/A resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log.
To create a Microsoft.Network/dnsZones/A resource, add the following Bicep to your template.
resource symbolicname 'Microsoft.Network/dnsZones/A@2016-04-01' = {
parent: resourceSymbolicName
etag: 'string'
name: 'string'
properties: {
AAAARecords: [
{
ipv6Address: 'string'
}
]
ARecords: [
{
ipv4Address: 'string'
}
]
CNAMERecord: {
cname: 'string'
}
metadata: {
{customized property}: 'string'
}
MXRecords: [
{
exchange: 'string'
preference: int
}
]
NSRecords: [
{
nsdname: 'string'
}
]
PTRRecords: [
{
ptrdname: 'string'
}
]
SOARecord: {
email: 'string'
expireTime: int
host: 'string'
minimumTTL: int
refreshTime: int
retryTime: int
serialNumber: int
}
SRVRecords: [
{
port: int
priority: int
target: 'string'
weight: int
}
]
TTL: int
TXTRecords: [
{
value: [
'string'
]
}
]
}
}
Property Values
Microsoft.Network/dnsZones/A
| Name |
Description |
Value |
| etag |
The etag of the record set. |
string |
| name |
The resource name |
string (required) |
| parent |
In Bicep, you can specify the parent resource for a child resource. You only need to add this property when the child resource is declared outside of the parent resource.
For more information, see Child resource outside parent resource. |
Symbolic name for resource of type: dnsZones |
| properties |
The properties of the record set. |
RecordSetProperties |
AaaaRecord
| Name |
Description |
Value |
| ipv6Address |
The IPv6 address of this AAAA record. |
string |
ARecord
| Name |
Description |
Value |
| ipv4Address |
The IPv4 address of this A record. |
string |
CnameRecord
| Name |
Description |
Value |
| cname |
The canonical name for this CNAME record. |
string |
MxRecord
| Name |
Description |
Value |
| exchange |
The domain name of the mail host for this MX record. |
string |
| preference |
The preference value for this MX record. |
int |
NsRecord
| Name |
Description |
Value |
| nsdname |
The name server name for this NS record. |
string |
PtrRecord
| Name |
Description |
Value |
| ptrdname |
The PTR target domain name for this PTR record. |
string |
RecordSetProperties
| Name |
Description |
Value |
| AAAARecords |
The list of AAAA records in the record set. |
AaaaRecord[] |
| ARecords |
The list of A records in the record set. |
ARecord[] |
| CNAMERecord |
The CNAME record in the record set. |
CnameRecord |
| metadata |
The metadata attached to the record set. |
RecordSetPropertiesMetadata |
| MXRecords |
The list of MX records in the record set. |
MxRecord[] |
| NSRecords |
The list of NS records in the record set. |
NsRecord[] |
| PTRRecords |
The list of PTR records in the record set. |
PtrRecord[] |
| SOARecord |
The SOA record in the record set. |
SoaRecord |
| SRVRecords |
The list of SRV records in the record set. |
SrvRecord[] |
| TTL |
The TTL (time-to-live) of the records in the record set. |
int |
| TXTRecords |
The list of TXT records in the record set. |
TxtRecord[] |
SoaRecord
| Name |
Description |
Value |
| email |
The email contact for this SOA record. |
string |
| expireTime |
The expire time for this SOA record. |
int |
| host |
The domain name of the authoritative name server for this SOA record. |
string |
| minimumTTL |
The minimum value for this SOA record. By convention this is used to determine the negative caching duration. |
int |
| refreshTime |
The refresh value for this SOA record. |
int |
| retryTime |
The retry time for this SOA record. |
int |
| serialNumber |
The serial number for this SOA record. |
int |
SrvRecord
| Name |
Description |
Value |
| port |
The port value for this SRV record. |
int |
| priority |
The priority value for this SRV record. |
int |
| target |
The target domain name for this SRV record. |
string |
| weight |
The weight value for this SRV record. |
int |
TxtRecord
| Name |
Description |
Value |
| value |
The text value of this TXT record. |
string[] |
Usage Examples
Bicep Samples
A basic example of deploying DNS A Record.
param resourceName string = 'acctest0001'
resource dnsZone 'Microsoft.Network/dnsZones@2018-05-01' = {
name: '${resourceName}.com'
location: 'global'
}
resource a 'Microsoft.Network/dnsZones/A@2018-05-01' = {
parent: dnsZone
name: resourceName
properties: {
ARecords: [
{
ipv4Address: '1.2.4.5'
}
{
ipv4Address: '1.2.3.4'
}
]
TTL: 300
metadata: {}
targetResource: {}
}
}
Azure Verified Modules
The following Azure Verified Modules can be used to deploy this resource type.
Azure Quickstart Samples
The following Azure Quickstart templates contain Bicep samples for deploying this resource type.
ARM template resource definition
The dnsZones/A resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log.
To create a Microsoft.Network/dnsZones/A resource, add the following JSON to your template.
{
"type": "Microsoft.Network/dnsZones/A",
"apiVersion": "2016-04-01",
"name": "string",
"etag": "string",
"properties": {
"AAAARecords": [
{
"ipv6Address": "string"
}
],
"ARecords": [
{
"ipv4Address": "string"
}
],
"CNAMERecord": {
"cname": "string"
},
"metadata": {
"{customized property}": "string"
},
"MXRecords": [
{
"exchange": "string",
"preference": "int"
}
],
"NSRecords": [
{
"nsdname": "string"
}
],
"PTRRecords": [
{
"ptrdname": "string"
}
],
"SOARecord": {
"email": "string",
"expireTime": "int",
"host": "string",
"minimumTTL": "int",
"refreshTime": "int",
"retryTime": "int",
"serialNumber": "int"
},
"SRVRecords": [
{
"port": "int",
"priority": "int",
"target": "string",
"weight": "int"
}
],
"TTL": "int",
"TXTRecords": [
{
"value": [ "string" ]
}
]
}
}
Property Values
Microsoft.Network/dnsZones/A
| Name |
Description |
Value |
| apiVersion |
The api version |
'2016-04-01' |
| etag |
The etag of the record set. |
string |
| name |
The resource name |
string (required) |
| properties |
The properties of the record set. |
RecordSetProperties |
| type |
The resource type |
'Microsoft.Network/dnsZones/A' |
AaaaRecord
| Name |
Description |
Value |
| ipv6Address |
The IPv6 address of this AAAA record. |
string |
ARecord
| Name |
Description |
Value |
| ipv4Address |
The IPv4 address of this A record. |
string |
CnameRecord
| Name |
Description |
Value |
| cname |
The canonical name for this CNAME record. |
string |
MxRecord
| Name |
Description |
Value |
| exchange |
The domain name of the mail host for this MX record. |
string |
| preference |
The preference value for this MX record. |
int |
NsRecord
| Name |
Description |
Value |
| nsdname |
The name server name for this NS record. |
string |
PtrRecord
| Name |
Description |
Value |
| ptrdname |
The PTR target domain name for this PTR record. |
string |
RecordSetProperties
| Name |
Description |
Value |
| AAAARecords |
The list of AAAA records in the record set. |
AaaaRecord[] |
| ARecords |
The list of A records in the record set. |
ARecord[] |
| CNAMERecord |
The CNAME record in the record set. |
CnameRecord |
| metadata |
The metadata attached to the record set. |
RecordSetPropertiesMetadata |
| MXRecords |
The list of MX records in the record set. |
MxRecord[] |
| NSRecords |
The list of NS records in the record set. |
NsRecord[] |
| PTRRecords |
The list of PTR records in the record set. |
PtrRecord[] |
| SOARecord |
The SOA record in the record set. |
SoaRecord |
| SRVRecords |
The list of SRV records in the record set. |
SrvRecord[] |
| TTL |
The TTL (time-to-live) of the records in the record set. |
int |
| TXTRecords |
The list of TXT records in the record set. |
TxtRecord[] |
SoaRecord
| Name |
Description |
Value |
| email |
The email contact for this SOA record. |
string |
| expireTime |
The expire time for this SOA record. |
int |
| host |
The domain name of the authoritative name server for this SOA record. |
string |
| minimumTTL |
The minimum value for this SOA record. By convention this is used to determine the negative caching duration. |
int |
| refreshTime |
The refresh value for this SOA record. |
int |
| retryTime |
The retry time for this SOA record. |
int |
| serialNumber |
The serial number for this SOA record. |
int |
SrvRecord
| Name |
Description |
Value |
| port |
The port value for this SRV record. |
int |
| priority |
The priority value for this SRV record. |
int |
| target |
The target domain name for this SRV record. |
string |
| weight |
The weight value for this SRV record. |
int |
TxtRecord
| Name |
Description |
Value |
| value |
The text value of this TXT record. |
string[] |
Usage Examples
Azure Quickstart Templates
The following Azure Quickstart templates deploy this resource type.
The dnsZones/A resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log.
To create a Microsoft.Network/dnsZones/A resource, add the following Terraform to your template.
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Network/dnsZones/A@2016-04-01"
name = "string"
parent_id = "string"
body = {
etag = "string"
properties = {
AAAARecords = [
{
ipv6Address = "string"
}
]
ARecords = [
{
ipv4Address = "string"
}
]
CNAMERecord = {
cname = "string"
}
metadata = {
{customized property} = "string"
}
MXRecords = [
{
exchange = "string"
preference = int
}
]
NSRecords = [
{
nsdname = "string"
}
]
PTRRecords = [
{
ptrdname = "string"
}
]
SOARecord = {
email = "string"
expireTime = int
host = "string"
minimumTTL = int
refreshTime = int
retryTime = int
serialNumber = int
}
SRVRecords = [
{
port = int
priority = int
target = "string"
weight = int
}
]
TTL = int
TXTRecords = [
{
value = [
"string"
]
}
]
}
}
}
Property Values
Microsoft.Network/dnsZones/A
| Name |
Description |
Value |
| etag |
The etag of the record set. |
string |
| name |
The resource name |
string (required) |
| parent_id |
The ID of the resource that is the parent for this resource. |
ID for resource of type: dnsZones |
| properties |
The properties of the record set. |
RecordSetProperties |
| type |
The resource type |
"Microsoft.Network/dnsZones/A@2016-04-01" |
AaaaRecord
| Name |
Description |
Value |
| ipv6Address |
The IPv6 address of this AAAA record. |
string |
ARecord
| Name |
Description |
Value |
| ipv4Address |
The IPv4 address of this A record. |
string |
CnameRecord
| Name |
Description |
Value |
| cname |
The canonical name for this CNAME record. |
string |
MxRecord
| Name |
Description |
Value |
| exchange |
The domain name of the mail host for this MX record. |
string |
| preference |
The preference value for this MX record. |
int |
NsRecord
| Name |
Description |
Value |
| nsdname |
The name server name for this NS record. |
string |
PtrRecord
| Name |
Description |
Value |
| ptrdname |
The PTR target domain name for this PTR record. |
string |
RecordSetProperties
| Name |
Description |
Value |
| AAAARecords |
The list of AAAA records in the record set. |
AaaaRecord[] |
| ARecords |
The list of A records in the record set. |
ARecord[] |
| CNAMERecord |
The CNAME record in the record set. |
CnameRecord |
| metadata |
The metadata attached to the record set. |
RecordSetPropertiesMetadata |
| MXRecords |
The list of MX records in the record set. |
MxRecord[] |
| NSRecords |
The list of NS records in the record set. |
NsRecord[] |
| PTRRecords |
The list of PTR records in the record set. |
PtrRecord[] |
| SOARecord |
The SOA record in the record set. |
SoaRecord |
| SRVRecords |
The list of SRV records in the record set. |
SrvRecord[] |
| TTL |
The TTL (time-to-live) of the records in the record set. |
int |
| TXTRecords |
The list of TXT records in the record set. |
TxtRecord[] |
SoaRecord
| Name |
Description |
Value |
| email |
The email contact for this SOA record. |
string |
| expireTime |
The expire time for this SOA record. |
int |
| host |
The domain name of the authoritative name server for this SOA record. |
string |
| minimumTTL |
The minimum value for this SOA record. By convention this is used to determine the negative caching duration. |
int |
| refreshTime |
The refresh value for this SOA record. |
int |
| retryTime |
The retry time for this SOA record. |
int |
| serialNumber |
The serial number for this SOA record. |
int |
SrvRecord
| Name |
Description |
Value |
| port |
The port value for this SRV record. |
int |
| priority |
The priority value for this SRV record. |
int |
| target |
The target domain name for this SRV record. |
string |
| weight |
The weight value for this SRV record. |
int |
TxtRecord
| Name |
Description |
Value |
| value |
The text value of this TXT record. |
string[] |
Usage Examples
A basic example of deploying DNS A Record.
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
}
}
}
provider "azapi" {
skip_provider_registration = false
}
variable "resource_name" {
type = string
default = "acctest0001"
}
variable "location" {
type = string
default = "westeurope"
}
resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
location = var.location
}
resource "azapi_resource" "dnsZone" {
type = "Microsoft.Network/dnsZones@2018-05-01"
parent_id = azapi_resource.resourceGroup.id
name = "${var.resource_name}.com"
location = "global"
schema_validation_enabled = false
response_export_values = ["*"]
}
resource "azapi_resource" "A" {
type = "Microsoft.Network/dnsZones/A@2018-05-01"
parent_id = azapi_resource.dnsZone.id
name = var.resource_name
body = {
properties = {
ARecords = [
{
ipv4Address = "1.2.4.5"
},
{
ipv4Address = "1.2.3.4"
},
]
TTL = 300
metadata = {
}
targetResource = {
}
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}