I tried to specify full URI in the vurtual_network_name and ansible can’t find the subnet within 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 some thing wrong ?. Or workaround pls ?
Help is much appreciated.
Thanks,
Shan