0

I am very new to Azure and currently looking for assistance to help me start my project. Recently I am trying to automate the process of adding alerts for our Azure CosmosDB.

After some research, it looks like I can use Add-AzMetricAlertRuleV2 to add alerts through powershell. According to MS online document I will need to pass $condition to add the rule to the existing ResourceGroup. Where can I get all the existing conditions that I can add to the rule so I can sort out the one that is needed? Some people use New-AzMetricAlertRuleV2Criteria to assign the value that need to be passed to $condition. And I can see some example from MS website: https://learn.microsoft.com/en-us/powershell/module/az.monitor/new-azmetricalertrulev2criteria?view=azps-5.0.0

However the above document from MS is not clear to me where I can find the whole list of the name spaces along with the existing criterias that I can add. For example, if I want to add an alert when a new cosmos DB is created on one of the existing ResourceGroup using powershell, where can I check what is the name space I can use to add the new criteria? In another word, where can I find out all the existing conditions with the name space along with them? Thanks,

Slow Snail
  • 137
  • 2
  • 12

1 Answers1

0

For cosmos DB, the metric namespace will be Microsoft.DocumentDB/databaseAccounts.

Harshita Singh
  • 4,590
  • 1
  • 10
  • 13
  • Thanks for the reply. I found this link which seems to have all the metrics under this name space. https://learn.microsoft.com/en-us/azure/azure-monitor/platform/metrics-supported#microsoftdocumentdbdatabaseaccounts – Slow Snail Nov 02 '20 at 14:22
  • Yes I can add simple alerts now using powershell. Need to test more with complicated alerts later. Thanks for checking! – Slow Snail Nov 11 '20 at 19:32