Search code examples
azurednsazure-cliazazure-dns

Convert powershell azure command into CLI


I need to convert below into a cli command into a CLI command and need some help.

New-AzDnsRecordSet -Name www -RecordType A -ZoneName host.com -ResourceGroupName devdnsgroup -Ttl 3600 -DnsRecords (New-AzDnsRecordConfig -IPv4Address "10.10.10.10")

I have started with:

az network dns record-set a add-record -g devdnsgroup -z host.com --ttl 3600

However I am unsure on how to accomplish the last part: -DnsRecords (New-AzDnsRecordConfig -IPv4Address "10.10.10.10")

Here is my reference https://learn.microsoft.com/en-us/cli/azure/network/dns/record-set/a?view=azure-cli-latest#az-network-dns-record-set-a-add-record


Solution

  • You can follow the command here

    az network dns record-set a add-record -g MyResourceGroup -z contoso.xyz -n www -a 10.10.10.10