azure_rm.py: msrestazure.azure_exceptions.CloudError: 403 Client Error

6 views
Skip to first unread message

Patrick Laimbock

unread,
Aug 30, 2017, 7:18:05 AM8/30/17
to ansible list
Hi,

Ansible 2.4 git from 5 mins ago.
Azure-SDK-for-python git from 20170824

I've created a Service Principal with Contributor role and am using a
~/.azure/credentials file. I've successfully launched a VM with Ansible
on Azure. Now I'm trying out the contrib/inventory/azure_rm.py script
and get the following error:

$ ./azure_rm.py --list
Traceback (most recent call last):
File "./azure_rm.py", line 842, in <module>
main()
File "./azure_rm.py", line 838, in main
AzureInventory()
File "./azure_rm.py", line 484, in __init__
self.get_inventory()
File "./azure_rm.py", line 550, in get_inventory
self._load_machines(virtual_machines)
File "./azure_rm.py", line 553, in _load_machines
for machine in machines:
File "/usr/lib/python2.7/site-packages/msrest/paging.py", line 109,
in __next__
self.advance_page()
File "/usr/lib/python2.7/site-packages/msrest/paging.py", line 95, in
advance_page
self._response = self._get_next(self.next_link)
File
"/usr/lib/python2.7/site-packages/azure/mgmt/compute/compute/v2017_03_30/operations/virtual_machines_operations.py",
line 762, in internal_paging
raise exp
msrestazure.azure_exceptions.CloudError: 403 Client Error: Forbidden

Anyone know what's causing this error? Specifying the client_id, secret,
tenant_id and subscription_id as options results in the same error.

Thanks!
Patrick
Reply all
Reply to author
Forward
0 new messages