azurepowershellazure-powershellazure-cliazure-private-dns

Creating an Azure Private DNS Zone A Recorset using CLI Commands: Parent Resource Not Found


I've deployed a blank Private DNS Zone ARM Template with the standards SOA recordset. I now need to add additional recordsets to this private dns zone using the Azure CLI commands.

The issue is the following error message:

az network dns record-set a add-record -g "MyResourceGroup" -z "MyPrivateDNSZoneName.net" -n "MyRecordSetName" -a "AnIP" 

Can not perform requested operation on nested resource. parent resource '' not found.

It isn't an access issue because I can add the recordset in the portal. I also get the same issue using the powershell commands. Is there something wrong with the way these strings are being passed to the portal?


Solution

  • According to the details of the error, it shows the parent resource can't be found. So the possible reasons here:

    1. You set the wrong subscription
    2. You set the wrong resource group
    3. You set the wrong DNS zone name

    So you need to check the above options to make sure if they're alright.