Azure PowerShell Version 1.0 has great benefits, and also has many breaking changes. Since I wrote about updating a naked domain RecordSet, I received a few questions. This is a post about adding a Subdomain to an existing RecordSet.
Most of breaking changes are minor. If your script leveraged Azure Resource Manager (ARM), start by replacing ‘-Azure‘ with ‘-AzureRm‘. This change was made because the Switch-AzureMode CmdLet was removed.
Using PowerShell to Add a Subdomain
Login-AzureRmAccount -SubscriptionName 'Visual Studio Ultimate with MSDN' $zone = Get-AzureRmDnsZone -Name 'alexandrebrisebois.com' ` -ResourceGroupName 'BriseboisDNS' $recordSet = New-AzureRmDnsRecordSet -Name 'liveqna' ` -Zone $zone ` -Ttl 60 ` -RecordType CNAME Add-AzureRmDnsRecordConfig -RecordSet $recordSet ` -Cname 'liveqna.eastus.cloudapp.azure.com' # Don't forget to use the Set-AzureRmDnsRecordSet cmdlet # to apply the changes Set-AzureRmDnsRecordSet -RecordSet $recordSet Resolve-DnsName -Name 'liveqna.alexandrebrisebois.com' -Type ALL -DnsOnly