I am trying to create a network interface in a resource group with name "net-interface" and associate it with a virtual network that belongs to resource group with name "virtual-net". I am able to do it manually, but when I use Ansible, it is expecting the virtual network to be in network interface resource group "net-interface". even tries giving the complete URI for the virtual network.
azure_rm_networkinterface:
name: testnetworkinfrastructure
resource_group: testsourcegroup1
virtual_network_name: /subscriptions/xxxxxxxxxxxxxxxxxxxxx/resourceGroups/testsourcegroup1/providers/Microsoft.Network/virtualNetworks/testvirtualnetwork
subnet_name: testsubnet
security_group_name: testsecuritygroup
location: West Europe
state: present
failed: [localhost] (item=ansible20-nic-01) => {"failed": true, "item": "ansible20-nic-01", "msg": "Error: fetching subnet testsubnet in virtual network /subscriptions/xxxxxxxxxxxxxxxxxxx/resourceGroups/testsourcegroup1/providers/Microsoft.Network/virtualNetworks/testvirtualnetwork - Azure Error: ResourceNotFound\nMessage: The Resource 'Microsoft.Network/virtualNetworks/subscriptions' under resource group 'testsourcegroup1' was not found."}
Am I doing something wrong? Or is there any workaround?