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.

  1. Azure Portal
  2. Azure PowerShell
  3. Azure CLI

Once again, PowerShell to the rescue!

  1. Create a CSV file with the following information ( In my case I only needed to create only A records ).
  1. Open an Elevated PowerShell Prompt and login to your Azure Subscription.
  1. 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!