Where to find condition value when using Add-AzMetricAlertRuleV2 in Azure powershell? - azure-cosmosdb

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,

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

Related

CosmosDB create compound unique index error

I wanted to create a compound unique index using 2 fields, but one of those has a path to some inner field like evaluated.rut. But I got an error:
I don't get the error, in MongoDB I had created index like that, but I can't now in CosmosDB, any suggestion?
Provided the nested path is not an array, the support for this is coming out very soon using the value EnableUniqueCompoundNestedDocs in the capabilities property array for a Cosmos DB databaseAccounts resource in ARM.
This is not yet publicly available. If you'd like to try today you can open a support ticket and ask this capability be added your Cosmos account. You can also DM me on Twitter (see my SO profile) and send me your Cosmos account name and I can request it for you.
You can refer to this document for what is not supported and its limitations.

Adding properties to output of current_principal_details() in Azure Data Explorer

I am implementing Row Level Security in Azure Data Explorer, I am using
current_principal_details()
To get information about the user but how can I add the names of the groups or something that the user is part of?
I cannot use
current_principal_is_member_of()
Since I will have over 6000 groups and the RLS query will be just too long so my idea is to add groups or roles or something to the user that I can see using
current_principal_details()
And the parse them and use that as input to the RLS query
I am using the following KUSTO to get the info of the user
print d=current_principal_details()
I just need to know how to add properties to the output and use them as input to RLS query

https://graph.microsoft.com/v1.0/deviceAppManagement/managedAppRegistrations filter on bundleId or packageId

I am trying to retrieve info from intune via GraphApi.
Want to filter on bundleId or packageId field (located under appIdentifier).
But I can't seem to find a way to do this.
Target result is :
userId,os_type (based on either #odata.type or packageId/bundleId).
Step further is that i want to identify certain apps by filtering on for example startswith(packageId,'com.microsoft').
I have tried combinations on "/deviceAppManagement/managedAppRegistrations?$filter=startswith(bundleId,'com.m'). But I keep on ending up on "invalid filter clause" whenever i want to execute a filter action.
Trying to recover from microsoft documentation if any filtering is possible on this part of graph seems impossible.
Currently we are using power automate to retrieve data and that works if we don't filter / select.
screenshot of json result
Use the following filter: startsWith(microsoft.graph.iosVppApp/bundleId, 'com.microsoft')
I found a pointer at this reddit post: https://www.reddit.com/r/Intune/comments/cxkwm3/using_graph_to_show_all_apps_from_one_vpp_token/

to get data from table without using reference of state

am trying to get the value from db without using serviceHub and vault.but i couldn't. what my logic is, when i pass the country name, it should return the id's(PK)of that country which is in one table.using those id's, it should return the values related to those id's from other table.it could be possible in flow class.but am trying to do in api class where servicehub couldn't import. Please help me out.
Only the node has access to the ServiceHub. The API runs outside of the node in a separate process, so it is limited to interacting with the node via the operations offered by CordaRPCOps.
Either you need to store the data you want to access in a separate database outside of the node, or you need to find some way to programatically log into the node's database from the API, using JDBC as described here: https://docs.corda.net/node-database.html.

Sql Database Server

Hi i have a sql database server runnin on my desktop. I want to create an asp.net application to detect when new data has been inserted into the database. Is there a command in visual studio to detect when theres new data right away?
Use the timestamp datatype on each column. This will stay identical until a change is made to any column in that row. If you combine this with the rowcount you can be certain if anything has changed in your database. You would need to cache the current timestamps and row count and compare them with the results of a query, you can then find out if there is a change.
So in your answer to:
Is there a command in visual studio to
detect when theres new data right
away?
Yes there is, although its not a command is the timestamp function (not to be confused with anything to do with the time)
Perhaps you need to provide more details to your scenario since constant querying of the database might not be the best way forward.
You can get a row count of your dataset and create a application
IN VB
Dim i as Integer
i=dataset.tables("table").rows.count
in sql backed return a count of a table and create a ASP.Net website to get the count and when count change alerts you
It may be heavier duty than you are looking for, but SQL Notification Services will do what you want. Essentially you execute a query and tell notification services you want to be notified whenever re-running that query would produce different results.
if you are using caching you can make it dependent on sql.
or you can fire email using sql trigger so when ever trigger get fired you will receive an email.
otherwise you will have to check your db again and again for any changes.
if you can provide more details about exact situation , we can provide more specific solution
You can create a webservice and call it using javascript.
here you can find sample how to call webservice using javascript:
function CallWebservice()
{
myWebService.isPrimeNumberWebService.callService(isPrimeNumberResult, "IsPrime",
testValue.value);
setTimeout("CallWebservice()",100);//here set time according to your requirement
}
For timer in javascript:
http://dotnetacademy.blogspot.com/2010/09/timer-in-javascript.html
For webservice in javaScript:
http://www.webreference.com/js/tips/020715.html
How to call webservice in JavaScript for FireFox 3.0

Resources