# Azure\_rm\_keyvault module - Authenticating with Azure

**URL:** <https://forum.ansible.com/t/azure-rm-keyvault-module-authenticating-with-azure/6131>\
**Category:** Get Help\
**Tags:** azure\
**Created:** [June 3, 2024, 10:43am UTC](https://forum.ansible.com/t/azure-rm-keyvault-module-authenticating-with-azure/6131 "2024-06-03T10:43:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fdercoli](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/fdercoli/32/3640_2.png) [@fdercoli](https://forum.ansible.com/u/fdercoli)\
**Post date:** [June 3, 2024, 10:43am UTC](https://forum.ansible.com/t/azure-rm-keyvault-module-authenticating-with-azure/6131/1 "2024-06-03T10:43:05Z")

</div>

Hello,

- I’m implementing an Azure Pipeline that automates the creation of an Azure Key Vault using the Ansible azure\_rm\_keyvault module (latest version)

- Currently, to authenticate the module with Azure, I use the service principal method, passing the AZURE\_SUBSCRIPTION\_ID, AZURE\_CLIENT\_ID, AZURE\_SECRET, and AZURE\_TENANT as environment variables.  
It works fine.

- For details, we’ve created an ARM service connection based on the Service Principal authentication and used the AzureCLI@2 task to retrieve all the environment variables that the azure\_rm\_keyvault module needs.

- For security reasons, we plan to migrate the service principal authentication from a secret to federated credentials (and thus remove the secret).  
However, we noted that in this case, we can’t retrieve the AZURE\_SECRET variable, and as a result, the azure\_rm\_keyvault module authentication fails.

Please, do you know how to authenticate the azure\_rm\_keyvault module with Azure when the service principal is configured using federated credentials instead of secrets?

If it is not possible, do you plan to add this authentication method to the module?

Thank you,  
Fabio
