diff --git a/lib/ansible/modules/cloud/azure/azure_rm_virtualnetwork.py b/lib/ansible/modules/cloud/azure/azure_rm_virtualnetwork.py index d53fad139a..9f1e7e61f2 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_virtualnetwork.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_virtualnetwork.py @@ -333,7 +333,7 @@ class AzureRMVirtualNetwork(AzureRMModuleBase): ), tags=results['tags'] ) - if results['dns_servers']: + if results.get('dns_servers'): vnet.dhcp_options = DhcpOptions( dns_servers=results['dns_servers'] )