Skip to content
This repository was archived by the owner on Aug 2, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions data/templates/Detector_VirtualMachineScaleSets.csx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using System.Threading;

private static string GetQuery(OperationContext<ArmResource> cxt)
{
return
$@"
let startTime = datetime({cxt.StartTime});
let endTime = datetime({cxt.EndTime});
YOUR_TABLE_NAME
| where TIMESTAMP >= startTime and TIMESTAMP <= endTime
YOUR_QUERY
";
}


[ArmResourceFilter(provider: "Microsoft.Compute", resourceTypeName: "virtualMachineScaleSets")]
[Definition(Id = "YOUR_DETECTOR_ID", Name = "", Author = "YOUR_ALIAS", Description = "")]
public async static Task<Response> Run(DataProviders dp, OperationContext<ArmResource> cxt, Response res)
{
res.Dataset.Add(new DiagnosticData()
{
Table = await dp.Kusto.ExecuteClusterQuery(GetQuery(cxt), "KUSTO_CLUSTER_NAME", "KUSTO_DB_NAME", null, "GetQuery"),
RenderingProperties = new Rendering(RenderingType.Table)
{
Title = "Sample Table",
Description = "Some description here"
}
});

return res;
}
10 changes: 10 additions & 0 deletions data/templates/Gist_VirtualMachineScaleSets.csx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;
using System.Threading;


[ArmResourceFilter(provider: "Microsoft.Compute", resourceTypeName: "virtualMachineScaleSets")]
[Definition(Id = "<YOUR_GIST_ID>", Name = "", Author = "<YOUR_ALIAS>", Description = "")]
public static class <YOUR_CLASS_NAME>
{

}