# How to use Microsoft Azure RM credentials in AWX

**URL:** <https://forum.ansible.com/t/how-to-use-microsoft-azure-rm-credentials-in-awx/31221>\
**Category:** AWX Project\
**Tags:** azure, awx\
**Created:** [September 7, 2019, 1:57pm UTC](https://forum.ansible.com/t/how-to-use-microsoft-azure-rm-credentials-in-awx/31221 "2019-09-07T13:57:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prashant\_Iyer](https://avatars.discourse-cdn.com/v4/letter/p/c37758/32.png) [@Prashant\_Iyer](https://forum.ansible.com/u/Prashant_Iyer)\
**Post date:** [September 7, 2019, 1:57pm UTC](https://forum.ansible.com/t/how-to-use-microsoft-azure-rm-credentials-in-awx/31221/1 "2019-09-07T13:57:36Z")

</div>

I have a template to create a RG in Azure.  
I have also created a Microsoft Azure RM Credentials (with subscription id,client-tenant ids, secret)  
However, I’m unable to find any doc reg how to use this credential to authenticate with Azure.  
Can anyone guide me how to use this Credential with this playbook

---

<div class="post-metadata">

**Author:** ![Juan\_A\_S](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@Juan\_A\_S](https://forum.ansible.com/u/Juan_A_S)\
**Post date:** [September 8, 2019, 10:06am UTC](https://forum.ansible.com/t/how-to-use-microsoft-azure-rm-credentials-in-awx/31221/2 "2019-09-08T10:06:54Z")

</div>

Hi Prashant

Without testing it, I have read this:

- [https://docs.ansible.com/ansible-tower/latest/html/userguide/credentials.html#microsoft-azure-resource-manager](https://docs.ansible.com/ansible-tower/latest/html/userguide/credentials.html#microsoft-azure-resource-manager)
- [https://docs.ansible.com/ansible/latest/scenario\_guides/guide\_azure.html](https://docs.ansible.com/ansible/latest/scenario_guides/guide_azure.html)
- [https://github.com/Azure-Samples/ansible-playbooks#how-to-run](https://github.com/Azure-Samples/ansible-playbooks#how-to-run)

So I think in your playbook/task, you should set some environment variables from template variables, that are filled by Tower:

- name: create vm  
env:
- AZURE\_CLIENT\_ID
- AZURE\_SECRET
- AZURE\_SUBSCRIPTION\_ID  
azure\_rm\_virtualmachine:  
…

And so on.
