Forum Discussion
Automated backup of Azure DNS Zone records
Hi Bryan! I know the post I am replying on is very old but it is exceptionally relevant to what I am currently fighting and I was hoping you could provide some direction.
I have a PowerShell script that I can log into the Azure Cloud Shell and run manually that exports all our public DNS zones and saves them to files. The goal is to get a backup. Obviously a manual backup is less than ideal so I am trying to automate this.
As you recommended, I have been fighting getting this working in an automation account for weeks now. Essentially, it is not recognizing the az command. In an effort to simplify troubleshooting I have created and published a runbook that runs only this (Resource Group name cut intentionally):
Az CLI is not available in the cloud hosted Automation workers.
You can either:
1) try to download and install Az CLI on the fly with PowerShell before running "az" commands. Of course, you would need first to authenticate with the Run As Account or other service principal.
2) use an Azure VM or a machine on-premises as a Hybrid Worker. Runbooks will run in this machine, which is owned by you and where you can install whatever dependencies are needed. If you want to reuse Run As Accounts inside the worker, you will have to install the Run As certificate.
- nickfletcherJan 18, 2021Copper Contributor
hspinto Just ot make sure I understand option 1 correctly, you mean in the script I am trying to run add the commands to download the Az CLI so it will install in the sandboxed environment each time it runs?
- hspintoJan 18, 2021
Microsoft
- nickfletcherJan 18, 2021Copper Contributor