# Query regarding Azure module in Metricbeat

**URL:** https://discuss.elastic.co/t/query-regarding-azure-module-in-metricbeat/273469
**Category:** Beats
**Tags:** beats-module, metricbeat
**Created:** [May 20, 2021, 5:09am UTC](https://discuss.elastic.co/t/query-regarding-azure-module-in-metricbeat/273469 "2021-05-20T05:09:56Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![adhiraj-g](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adhiraj-g/32/88997_2.png) [@adhiraj-g](https://discuss.elastic.co/u/adhiraj-g)
#### Post date: [May 20, 2021, 5:09am UTC](https://discuss.elastic.co/t/query-regarding-azure-module-in-metricbeat/273469/1 "2021-05-20T05:09:56Z")

</div>

Hi There,

For Azure Module in metricbeat, we are required to create a service principal with relevant access permissions in order to access metrics data from Azure.

In case of Azure setup with multiple ADs, how do we monitor data?  
Is it possible to use a single AD to access setup over other ADs or can we configure multiple Service principal details in metricbeats azure module configuration?

With the help of azure monitor metricset, can we access metrics from all APIs mentioned in below link

> **[Azure Monitor supported metrics by resource type - Azure Monitor](https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/metrics-supported)**
>
> List of metrics available for each resource type with Azure Monitor.

Also, for billing metric, does it support data retrieval for pay as you go subscriptions?  
What all data can we fetch out from the Azure Consumption APIs mentioned in the link below?  
[https://docs.microsoft.com/en-us/rest/api/consumption/](https://docs.microsoft.com/en-us/rest/api/consumption/)

Any suggestions, would be really helpful.

---

<div class="post-metadata">

### Author: ![Kaiyan\_Sheng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kaiyan_sheng/32/38247_2.png) [@Kaiyan\_Sheng](https://discuss.elastic.co/u/Kaiyan_Sheng)
#### Post date: [May 20, 2021, 9:37pm UTC](https://discuss.elastic.co/t/query-regarding-azure-module-in-metricbeat/273469/2 "2021-05-20T21:37:29Z")

</div>

@MarianaD Could we get your help on this one please 🙂

---

<div class="post-metadata">

### Author: ![adhiraj-g](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adhiraj-g/32/88997_2.png) [@adhiraj-g](https://discuss.elastic.co/u/adhiraj-g)
#### Post date: [May 30, 2021, 7:28pm UTC](https://discuss.elastic.co/t/query-regarding-azure-module-in-metricbeat/273469/3 "2021-05-30T19:28:58Z")

</div>

Hi @Kaiyan_Sheng and @MarianaD,  
Hope to hear back from you soon.

---

<div class="post-metadata">

### Author: ![MarianaD](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marianad/32/42687_2.png) [@MarianaD](https://discuss.elastic.co/u/MarianaD)
#### Post date: [June 1, 2021, 12:51pm UTC](https://discuss.elastic.co/t/query-regarding-azure-module-in-metricbeat/273469/4 "2021-06-01T12:51:32Z")

</div>

> Also, for billing metric, does it support data retrieval for pay as you go subscriptions?  
> What all data can we fetch out from the Azure Consumption APIs mentioned in the link below?  
> [Azure Consumption REST APIs | Microsoft Learn](https://docs.microsoft.com/en-us/rest/api/consumption/)

I do not believe so, we've created an issue regarding updating the Azure SDK version to one that supports more subscription types, still waiting.  
[Provide 2019-10-01 version of consumption APIs · Issue #12452 · Azure/azure-sdk-for-go (github.com)](https://github.com/Azure/azure-sdk-for-go/issues/12452)

Not sure if this was a question:

> With the help of azure monitor metricset, can we access metrics from all APIs mentioned in below link

Yes, that should be the list of namespaces/metrics the metric API will return.

> In case of Azure setup with multiple ADs, how do we monitor data?  
> Is it possible to use a single AD to access setup over other ADs or can we configure multiple Service principal details in metricbeats azure module configuration?

I believe you can configure multiple configurations (service principal details) in one azure module config file. Ex:

```auto
- module: azure
  metricsets:
  - compute_vm
  enabled: true
  period: 300s
  client_id: 'azureclient1'
  client_secret: 'clientsecret1'
  tenant_id: 'azuretenant1'
  subscription_id: 'subscription1'
  refresh_list_interval: 600s

- module: azure
  metricsets:
  - compute_vm_scaleset
  enabled: true
  period: 300s
  client_id: 'azureclient2'
  client_secret: clientsecret2'
  tenant_id: 'azuretenant2'
  subscription_id: 'subscription2'
  refresh_list_interval: 600s

```

---

<div class="post-metadata">

### Author: ![adhiraj-g](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adhiraj-g/32/88997_2.png) [@adhiraj-g](https://discuss.elastic.co/u/adhiraj-g)
#### Post date: [June 3, 2021, 5:36pm UTC](https://discuss.elastic.co/t/query-regarding-azure-module-in-metricbeat/273469/5 "2021-06-03T17:36:15Z")

</div>

Hello @MarianaD ,

Thank you so much. This was indeed helpful.

I just have a few more queries. Would really appreciate it, if you can help with those as well.

In the module configurations, "period" refers to Time grain and the "refresh\_list\_interval" The time gap each REST API Call Correct?

How do we specify the time range of data (ex: data for last 1 hour) to be fetched or is there any default range?

Hope to hear back from you soon.

---

<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: [July 1, 2021, 7:37pm UTC](https://discuss.elastic.co/t/query-regarding-azure-module-in-metricbeat/273469/6 "2021-07-01T19:37:03Z")

</div>

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