Reading Time: 2 minutes
Earlier today I needed to quickly create a bunch of DNS entries under my DNS Zone hosted in Azure DNS Service. Currently, there are three ways of creating/importing DNS records.
- Azure Portal
- Azure PowerShell
- Azure CLI
Once again, PowerShell to the rescue!
- Create a CSV file with the following information ( In my case I only needed to create only A records ).
- Open an Elevated PowerShell Prompt and login to your Azure Subscription.
- Run the following cmdlet ( alter the Path information ).
Import-CSV -Path "Path of the CSV File" | ForEach-Object { New-AzureRmDnsRecord
Set -Name $_.name -RecordType $_.RecordType -ZoneName $_.ZoneName -ResourceGroupName $_.ResourceGroupName
-Ttl $_.TTL -DnsRecords (New-AzureRmDnsRecordConfig -IPv4Address $_.IP) }
PowerShell output.
Azure Portal, looking good huh?
Thanks for reading!
You must be logged in to post a comment.