# How to connect to azure key vault using service principal and .pem file

**URL:** <https://forum.ansible.com/t/how-to-connect-to-azure-key-vault-using-service-principal-and-pem-file/35612>\
**Category:** Ansible Project\
**Tags:** azure\
**Created:** [August 11, 2021, 4:49pm UTC](https://forum.ansible.com/t/how-to-connect-to-azure-key-vault-using-service-principal-and-pem-file/35612 "2021-08-11T16:49:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Teja](https://avatars.discourse-cdn.com/v4/letter/t/d07c76/32.png) [@Teja](https://forum.ansible.com/u/Teja)\
**Post date:** [August 11, 2021, 4:49pm UTC](https://forum.ansible.com/t/how-to-connect-to-azure-key-vault-using-service-principal-and-pem-file/35612/1 "2021-08-11T16:49:41Z")

</div>

Hi All,

I was trying to use ansible to get/set secrets in azure key vault. in azure\_rm\_keyvaultsecret module we have only secret argument to provide credentials for the service principal. but our requirement is to use .pem file to authenticate the Service principal  
so can some one help us with the following please.

1. how to provide a .pem file to authenticate the service principal to connect Azure key vault.
2. is there any other way/ module to achieve our requirement.

Thanks & Regards,  
Tejaswini Akula.
