Search code examples
powershellazurednsmail-server

Azure PowerShell - Set-AzureService : ResourceNotFound: The hosted service does not exist


I was recently trying to configure reverse dns for my mail server (which is hosted on Azure). But everytime I try this command:

Set-AzureService –ServiceName “MyVMName” -Description "VM with reverse dns" –ReverseDnsFqdn “myvmname.cloudapp.net."

It can't find the resource:

(Set-AzureService : ResourceNotFound: The hosted service does not exist.)

And when I type in Get-AzureRmResource, I have all my resources, including my VM. So I don't understand, I really hope you guys can help me, because it's almost like I can't send mail without the reverse dns record.


Solution

  • From what I see, your Virtual Machine is created with Azure Resource Manager, while you try to set the reverse DNS entry using the Azure Service Management. This will not work. Here is an article describing what is the difference between Azure Resource Manager and Azure Service Management and why that matters. And here is an article on how to set Reverse DNS for your VM using Resource Manager.