You need to download and install the module for azure DNS first
First check the power shell version because Azure RM module need power shell 5.0 at least.
Install-Module -Name AzureRM
By default, the PowerShell gallery isn’t configured as a trusted repository for PowerShellGet. The first time you use the PSGallery you see the following prompt:
You are installing the modules from an untrusted repository. If you trust this repository, change its Installation Policy value by running the
Are you sure you want to install the modules from ‘PSGallery’?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is “N”):
# Import the module into the PowerShell session
# Connect to Azure with an interactive dialog for sign-in
Update-Module -Name AzureRM