# Unable to Load Inventory from Azure

**URL:** <https://forum.ansible.com/t/unable-to-load-inventory-from-azure/25536>\
**Category:** AWX Project\
**Tags:** azure, awx\
**Created:** [September 19, 2017, 9:10pm UTC](https://forum.ansible.com/t/unable-to-load-inventory-from-azure/25536 "2017-09-19T21:10:22Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nigel\_M](https://avatars.discourse-cdn.com/v4/letter/n/a4c791/32.png) [@Nigel\_M](https://forum.ansible.com/u/Nigel_M)\
**Post date:** [September 19, 2017, 9:10pm UTC](https://forum.ansible.com/t/unable-to-load-inventory-from-azure/25536/1 "2017-09-19T21:10:22Z")

</div>

Evaluating AWX and just got it installed. Set up Azure (Microsoft Azure Resource Manager) as a an Inventory Source and attempting to sync. It appears to be connecting ok, but AWX is saying we don’t have any hosts. We have a few hundred on this Azure account. Here are the logs from the sync job: 2017-09-19 20:45:51,675 INFO awx.main.commands.inventory\_import Updating inventory 4: azure-prd9 2017-09-19 20:45:51,692 INFO awx.main.commands.inventory\_import Reading Ansible inventory source: /usr/lib/python2.7/site-packages/awx/plugins/inventory/azure\_rm.py 2017-09-19 20:45:58,095 INFO awx.main.commands.inventory\_import Processing JSON output… 2017-09-19 20:45:58,095 DEBUG awx.main.commands.inventory\_import Loaded group: all 2017-09-19 20:45:58,095 DEBUG awx.main.commands.inventory\_import Loaded group: azure 2017-09-19 20:45:58,095 DEBUG awx.main.commands.inventory\_import Adding child group azure to parent all 2017-09-19 20:45:58,095 DEBUG awx.main.commands.inventory\_import Adding child group azure to parent all 2017-09-19 20:45:58,095 DEBUG awx.main.commands.inventory\_import Finished loading from source: /usr/lib/python2.7/site-packages/awx/plugins/inventory/azure\_rm.py 2017-09-19 20:45:58,096 DEBUG awx.main.commands.inventory\_import Removing empty group azure 2017-09-19 20:45:58,096 INFO awx.main.commands.inventory\_import Loaded 0 groups, 0 hosts 2017-09-19 20:45:58,178 INFO awx.main.commands.inventory\_import Inventory variables unmodified 2017-09-19 20:45:58,181 DEBUG awx.main.models.inventory Going to update inventory computed fields 2017-09-19 20:45:58,217 DEBUG awx.main.models.inventory Finished updating inventory computed fields 2017-09-19 20:45:58,218 INFO awx.main.commands.inventory\_import Inventory import completed for azure-prd9 in 6.5s Am I missing something? Thanks!

---

<div class="post-metadata">

**Author:** ![matburt](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/matburt/32/3612_2.png) [@matburt](https://forum.ansible.com/u/matburt)\
**Post date:** [September 20, 2017, 1:05am UTC](https://forum.ansible.com/t/unable-to-load-inventory-from-azure/25536/2 "2017-09-20T01:05:54Z")

</div>

azure can be a little picky in it’s configuration. Can you get the expected results if you run the standalone inventory script (which is what awx itself uses): [http://docs.ansible.com/ansible/latest/guide\_azure.html#dynamic-inventory-script](http://docs.ansible.com/ansible/latest/guide_azure.html#dynamic-inventory-script)

---

<div class="post-metadata">

**Author:** ![Nigel\_M](https://avatars.discourse-cdn.com/v4/letter/n/a4c791/32.png) [@Nigel\_M](https://forum.ansible.com/u/Nigel_M)\
**Post date:** [September 20, 2017, 3:33pm UTC](https://forum.ansible.com/t/unable-to-load-inventory-from-azure/25536/3 "2017-09-20T15:33:59Z")

</div>

Thanks, I was able to run the command manually without any issues. Perhaps there is a way for me to enable more detailed logging? Thanks again.

---

<div class="post-metadata">

**Author:** ![matburt](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/matburt/32/3612_2.png) [@matburt](https://forum.ansible.com/u/matburt)\
**Post date:** [September 20, 2017, 5:52pm UTC](https://forum.ansible.com/t/unable-to-load-inventory-from-azure/25536/4 "2017-09-20T17:52:41Z")

</div>

Which inventory script did you use to test with on Ansible itself?

---

<div class="post-metadata">

**Author:** ![Nigel\_M](https://avatars.discourse-cdn.com/v4/letter/n/a4c791/32.png) [@Nigel\_M](https://forum.ansible.com/u/Nigel_M)\
**Post date:** [September 20, 2017, 7:21pm UTC](https://forum.ansible.com/t/unable-to-load-inventory-from-azure/25536/5 "2017-09-20T19:21:45Z")

</div>

I ran azure\_rm.py

---

<div class="post-metadata">

**Author:** ![matburt](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/matburt/32/3612_2.png) [@matburt](https://forum.ansible.com/u/matburt)\
**Post date:** [September 20, 2017, 7:30pm UTC](https://forum.ansible.com/t/unable-to-load-inventory-from-azure/25536/6 "2017-09-20T19:30:55Z")

</div>

Testing it here it looks like it works for us. Without some more details on your authentication method and what you put in your .ini file and environment it’s hard to see where things are going wrong.

---

<div class="post-metadata">

**Author:** ![Nigel\_M](https://avatars.discourse-cdn.com/v4/letter/n/a4c791/32.png) [@Nigel\_M](https://forum.ansible.com/u/Nigel_M)\
**Post date:** [September 21, 2017, 1:33am UTC](https://forum.ansible.com/t/unable-to-load-inventory-from-azure/25536/7 "2017-09-21T01:33:38Z")

</div>

I got it to work. I found that when I select region as “All”, it does not work. Specifying a single region or multiple individual regions and it will work.

Thanks for the help.

---

<div class="post-metadata">

**Author:** ![matburt](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/matburt/32/3612_2.png) [@matburt](https://forum.ansible.com/u/matburt)\
**Post date:** [September 21, 2017, 2:06am UTC](https://forum.ansible.com/t/unable-to-load-inventory-from-azure/25536/8 "2017-09-21T02:06:33Z")

</div>

That’s very interesting, let me see what’s up with that.

---

<div class="post-metadata">

**Author:** ![rpetrell](https://avatars.discourse-cdn.com/v4/letter/r/b4bc9f/32.png) [@rpetrell](https://forum.ansible.com/u/rpetrell)\
**Post date:** [September 21, 2017, 7:07pm UTC](https://forum.ansible.com/t/unable-to-load-inventory-from-azure/25536/9 "2017-09-21T19:07:25Z")

</div>

Nigel,

It looks like you’ve found a bug in awx! The good news is that it should be pretty simple to fix - I’m taking a look at it now.

In the meantime, your workaround (removing the region entirely) should accomplish what you’re looking for.

Thanks!

---

<div class="post-metadata">

**Author:** ![Nigel\_M](https://avatars.discourse-cdn.com/v4/letter/n/a4c791/32.png) [@Nigel\_M](https://forum.ansible.com/u/Nigel_M)\
**Post date:** [September 21, 2017, 8:20pm UTC](https://forum.ansible.com/t/unable-to-load-inventory-from-azure/25536/10 "2017-09-21T20:20:20Z")

</div>

Cool. Shall I open a bug for you guys?

---

<div class="post-metadata">

**Author:** ![matburt](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/matburt/32/3612_2.png) [@matburt](https://forum.ansible.com/u/matburt)\
**Post date:** [September 21, 2017, 8:35pm UTC](https://forum.ansible.com/t/unable-to-load-inventory-from-azure/25536/11 "2017-09-21T20:35:09Z")

</div>

We’ll pick up the changes from our downstream hardening in a few days, so not strictly necessary.
