# List active directory user & group details  from azure with ansible modules

**URL:** <https://forum.ansible.com/t/list-active-directory-user-group-details-from-azure-with-ansible-modules/31614>\
**Category:** Ansible Project\
**Tags:** azure\
**Created:** [November 7, 2019, 1:49am UTC](https://forum.ansible.com/t/list-active-directory-user-group-details-from-azure-with-ansible-modules/31614 "2019-11-07T01:49:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamlightsocialxen](https://avatars.discourse-cdn.com/v4/letter/i/ee59a6/32.png) [@iamlightsocialxen](https://forum.ansible.com/u/iamlightsocialxen)\
**Post date:** [November 7, 2019, 1:49am UTC](https://forum.ansible.com/t/list-active-directory-user-group-details-from-azure-with-ansible-modules/31614/1 "2019-11-07T01:49:55Z")

</div>

Hello Experts,

I am trying to use ansible for azure automation and want to use ansible as much as possible for resources creation and auto assigning the role based access.

While doing so , I couldn’t find any replacement for below az cli in ansible module.

“az ad user show --id [username@example.com](mailto:username@example.com)” ( I am doing this to get the ObjectId of the user and group so that i can use that with azure\_rm\_roleassignment module)

Do anyone have suggestion how do we address this ? Also for any az cli if there is no substitute , How one handles this ? If one calls the az cli in playbook then how does he pass the credentials (mainly service principal ).

Looking forward to suggestions.

Regards,  
Prakash.
