-
Notifications
You must be signed in to change notification settings - Fork 10
Add ArmPrivateDnsZoneARecord
danieljosephh edited this page Feb 5, 2020
·
1 revision
Add-ArmPrivateDnsZoneARecord
creates a new private DNS zone A record. A private DNS zone (New-ArmPrivateDnsZone) is required to use this function. The private DNS zone object will be returned by this function.
# 1. Simple (required parameters)
# a) Pipeline input (private DNS zone only)
"contoso.com" | New-ArmPrivateDnsZone `
| Add-ArmPrivateDnsZoneARecord `
-Name "resource" `
-IpV4Addresses @("address1", "address2")
# b) Explicit specification of parameter name/argument
$PrivateDnsZone = New-ArmPrivateDnsZone -Name "contoso.com"
Add-ArmPrivateDnsZoneARecord `
-PrivateDnsZone $PrivateDnsZone
-Name "aRecordName" `
-IpV4Addresses @("address1", "address2")
# result:
{
_ResourceId : "[resourceId('Microsoft.Network/privateDnsZones/A','contoso.com','resource')]"
PSTypeName : "PDNSZARecord"
type : "Microsoft.Network/privateDnsZones/A"
name : "[concat('contoso.com', '/', 'resource')]"
apiVersion : "2018-09-01"
location : "global"
properties : {
ttl : 3600
aRecords : [
{ ipv4Address : "address1" },
{ ipv4Address : "address2" }
]
}
dependsOn : ["[resourceId('Microsoft.Network/privateDnsZones','contoso.com')]"]
}
# 2. Optional parameters (TTL is the minimum time to live in seconds)
"contoso.com" | New-ArmPrivateDnsZone `
| Add-ArmPrivateDnsZoneARecord `
-Name "aRecordName" `
-IpV4Addresses @("address1", "address2") `
-TTL 400
# result:
{
_ResourceId : "[resourceId('Microsoft.Network/privateDnsZones/A','contoso.com','resource')]"
PSTypeName : "PDNSZARecord"
type : "Microsoft.Network/privateDnsZones/A"
name : "contoso.com"
apiVersion : "2018-09-01"
location : "global"
properties : {
ttl : 400
aRecords : [
{ ipv4Address : "address1" },
{ ipv4Address : "address2" }
]
}
dependsOn : ["[resourceId('Microsoft.Network/privateDnsZones','contoso.com')]"]
}