##### SUMMARY
When using azure_rm inventory plug-in, given Azure subscription, the dynamic inventory results in an incomplete list of VMs, compared to the one that can be obtained in portal.azure.com or via Azure CLI. 

The issue is mainly due to a parsing error that occurs in azure_rm.py. The code expects the 'primary' field to exist in the __nic_model['ipConfigurations'][X]['properties']__ dict. In our existing fleet of Azure VMs, some VMs do not have a primary ipConfiguration set. More precisely, that field is set to 'null', not 'True' or 'False'.

Example:
1. Using Azure cli, dump the ipConfiguration of VM vm01 that has the 'primary' field set to 'true':
```bash
az network nic ip-config list --subscription MySubscription -g MyRG --nic-name vm01nic
[
  {
    "applicationGatewayBackendAddressPools": null,
    "applicationSecurityGroups": null,
    "etag": "W/\"***\"",
    "id": "/subscriptions/***/resourceGroups/***/providers/Microsoft.Network/networkInterfaces/vm01nic/ipConfigurations/ipconfig1",
    "loadBalancerBackendAddressPools": null,
    "loadBalancerInboundNatRules": null,
    "name": "ipconfig1",
    "primary": true,
    "privateIpAddress": "***",
    "privateIpAddressVersion": "IPv4",
    "privateIpAllocationMethod": "Static",
    "provisioningState": "Succeeded",
    "publicIpAddress": null,
    "resourceGroup": "***",
    "subnet": {
      "addressPrefix": null,
      "etag": null,
      "id": "/subscriptions/***/resourceGroups/***/providers/Microsoft.Network/virtualNetworks/***/subnets/***",
      "ipConfigurations": null,
      "name": null,
      "networkSecurityGroup": null,
      "provisioningState": null,
      "resourceGroup": "***",
      "resourceNavigationLinks": null,
      "routeTable": null,
      "serviceEndpoints": null
    },
    "type": "Microsoft.Network/networkInterfaces/ipConfigurations"
  }
]
```
2. Using Azure cli, dump the ipConfiguration of VM vm02 that does not have a boolean value for the 'primary' field:
```bash
az network nic ip-config list --subscription MySubscription -g MyRG --nic-name vm02nic
[
  {
    "applicationGatewayBackendAddressPools": null,
    "applicationSecurityGroups": null,
    "etag": "W/\"***\"",
    "id": "/subscriptions/***/resourceGroups/***/providers/Microsoft.Network/networkInterfaces/vm02nic/ipConfigurations/ipconfig1",
    "loadBalancerBackendAddressPools": null,
    "loadBalancerInboundNatRules": null,
    "name": "ipconfig1",
    "primary": null,
    "privateIpAddress": "***",
    "privateIpAddressVersion": "IPv4",
    "privateIpAllocationMethod": "Static",
    "provisioningState": "Succeeded",
    "publicIpAddress": null,
    "resourceGroup": "***",
    "subnet": {
      "addressPrefix": null,
      "etag": null,
      "id": "/subscriptions/***/resourceGroups/***/providers/Microsoft.Network/virtualNetworks/***/subnets/***",
      "ipConfigurations": null,
      "name": null,
      "networkSecurityGroup": null,
      "provisioningState": null,
      "resourceGroup": "***",
      "resourceNavigationLinks": null,
      "routeTable": null,
      "serviceEndpoints": null
    },
    "type": "Microsoft.Network/networkInterfaces/ipConfigurations"
  }
]
```

In the second example, because of the 'null' value, that field is later removed from the __nic_model__ dict., causing a python error while fetching the inventory.

##### ISSUE TYPE
- Bug Report

##### COMPONENT NAME
lib/ansible/plugins/inventory/azure_rm.py

##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes -->
```paste below
ansible 2.8.5
  config file = /home/***/ansible/ansible_dev.cfg
  configured module search path = [u'/home/***/ansible/library']
  ansible python module location = /home/***/ansible/.venv/lib/python2.7/site-packages/ansible
  executable location = /home/***/ansible/.venv/bin/ansible
  python version = 2.7.5 (default, Jun 11 2019, 14:33:56) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
```

##### CONFIGURATION
<!--- Paste verbatim output from "ansible-config dump --only-changed" between quotes -->
```paste below
DEFAULT_BECOME_METHOD(/home/***/ansible/ansible_dev.cfg) = sudo
DEFAULT_BECOME_USER(/home/***/ansible/ansible_dev.cfg) = root
DEFAULT_GATHER_TIMEOUT(/home/***/ansible/ansible_dev.cfg) = 30
DEFAULT_HOST_LIST(/home/***/ansible/ansible_dev.cfg) = [u'/home/***/ansible/inventory/azure-dev']
DEFAULT_LOG_PATH(/home/***/ansible/ansible_dev.cfg) = /home/***/ansible.log
DEFAULT_MODULE_PATH(/home/***/ansible/ansible_dev.cfg) = [u'/home/***/ansible/library']
DEFAULT_ROLES_PATH(/home/***/ansible/ansible_dev.cfg) = [u'/home/***/ansible/roles']
DEFAULT_VAULT_IDENTITY_LIST(/home/***/ansible/ansible_dev.cfg) = ***
HOST_KEY_CHECKING(/home/***/ansible/ansible_dev.cfg) = False
INVENTORY_ENABLED(/home/***/ansible/ansible_dev.cfg) = [u'yaml', u'azure_rm', u'script']
RETRY_FILES_ENABLED(/home/***/ansible/ansible_dev.cfg) = False
```

##### OS / ENVIRONMENT
Ansible controller on RHEL 7.4

##### STEPS TO REPRODUCE
<!--- Describe exactly how to reproduce the problem, using a minimal test-case -->
1. Use a resource group with one VM that is correctly retrieved via the azure_rm plugin.
1. In that resource group, create another VM with at least one NIC but with no primary ipConfiguration (I don't know whether it is still possible to do so but in our existing fleet of VMs, some do not have any NIC with a primary ipConfiguration)
1. Relaunch the dynamic inventory.

##### EXPECTED RESULTS
All resource group VMs are retrieved.

##### ACTUAL RESULTS
No VM shows up

batch_fetch:
            description: To improve performance, results are fetched using an unsupported batch API. Disabling
                C(batch_fetch) uses a much slower serial fetch, resulting in many more round-trips. Generally only
                useful for troubleshooting.
            default: true
        default_host_filters:
            description: A default set of filters that is applied in addition to the conditions in
                C(exclude_host_filters) to exclude powered-off and not-fully-provisioned hosts. Set this to a different
                value or empty list if you need to include hosts in these states.
            default: ['powerstate != "running"', 'provisioning_state != "succeeded"']
        use_contrib_script_compatible_sanitization:
          description:
            - By default this plugin is using a general group name sanitization to create safe and usable group names for use in Ansible.
              This option allows you to override that, in efforts to allow migration from the old inventory script and
              matches the sanitization of groups when the script's ``replace_dash_in_groups`` option is set to ``False``.
              To replicate behavior of ``replace_dash_in_groups = True`` with constructed groups,
              you will need to replace hyphens with underscores via the regex_replace filter for those entries.
            - For this to work you should also turn off the TRANSFORM_INVALID_GROUP_CHARS setting,
              otherwise the core engine will just use the standard sanitization on top.
            - This is not the default as such names break certain functionality as not all characters are valid Python identifiers
              which group names end up being used as.
          type: bool
          default: False
          version_added: '2.8'
        plain_host_names:
          description:
            - By default this plugin will use globally unique host names.
              This option allows you to override that, and use the name that matches the old inventory script naming.
            - This is not the default, as these names are not truly unique, and can conflict with other hosts.
              The default behavior will add extra hashing to the end of the hostname to prevent such conflicts.