# Secret in Azure module Metricbeat

**URL:** https://discuss.elastic.co/t/secret-in-azure-module-metricbeat/298412
**Category:** Beats
**Tags:** metricbeat
**Created:** [February 28, 2022, 2:34pm UTC](https://discuss.elastic.co/t/secret-in-azure-module-metricbeat/298412 "2022-02-28T14:34:14Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![legos765](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/legos765/32/101540_2.png) [@legos765](https://discuss.elastic.co/u/legos765)
#### Post date: [February 28, 2022, 2:34pm UTC](https://discuss.elastic.co/t/secret-in-azure-module-metricbeat/298412/1 "2022-02-28T14:34:14Z")

</div>

Hello,

I'm trying to implement Azure module in Metricbeat version 7.17. And im getting error when it is connecting to Azure:

```auto
Refresh request failed. Status Code = '401'. Response body: {"error":"invalid_client","error_description":"AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app

```

Following the instruction here: [Azure module | Metricbeat Reference [7.17] | Elastic](https://www.elastic.co/guide/en/beats/metricbeat/7.17/metricbeat-module-azure.html)

I should be able to connect using service principal secret. But in my environment I would like to use certificate-based authentication (like mentioned here [Use Azure service principals with Azure PowerShell | Microsoft Docs](https://docs.microsoft.com/en-us/powershell/azure/create-azure-service-principal-azureps?view=azps-7.2.0&viewFallbackFrom=azps-2.7.0)) instead of password one. I tried paste the cert into ${AZURE\_CLIENT\_SECRET}, but I got error like above.

Question: Is certificate-based authentication supported by Azure module in Metricbeat and could you provide me an example how it should looks like?

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [March 28, 2022, 4:35pm UTC](https://discuss.elastic.co/t/secret-in-azure-module-metricbeat/298412/2 "2022-03-28T16:35:07Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
