ghunt
ghunt

Reputation: 1

How to export Azure DNS zone records to Azure storage

I am trying to find a way to automate the backup of an Azure DNS Zone.

The following command allows me to backup the zone to a file on a local machine, but I would ideally like to backup up azure storage (blob).

az network dns zone export -g resourcegroup -n dnszone.co.uk -f output.txt https://learn.microsoft.com/en-us/azure/dns/dns-import-export

I have tried using the above with the 'az storage blob upload' command but with no joy. Maybe im on the wrong track

Upvotes: 0

Views: 4754

Answers (1)

Nancy Xiong
Nancy Xiong

Reputation: 28224

As your requirement, you can follow these steps to upload your DNS zone file to Azure storage account.

  1. Export the DNS zone file using this Azure CLI command:

    az network dns zone export -g myresourcegroup -n contoso.com -f /path/to/zonefile.txt

    enter image description here

  2. Upload the exported DNS zone file to Azure blob storage using this Azure CLI command:

    az storage blob upload -f /path/to/file -c MyContainer -n MyBlob --account-name xxxx --account-key xxxx enter image description here enter image description here

If you have any question, please let me know.

Upvotes: 0

Related Questions