diff --git a/data/templates/Detector_VirtualMachineScaleSets.csx b/data/templates/Detector_VirtualMachineScaleSets.csx new file mode 100644 index 000000000..28d8d9964 --- /dev/null +++ b/data/templates/Detector_VirtualMachineScaleSets.csx @@ -0,0 +1,32 @@ +using System; +using System.Threading; + +private static string GetQuery(OperationContext 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 Run(DataProviders dp, OperationContext 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; +} diff --git a/data/templates/Gist_VirtualMachineScaleSets.csx b/data/templates/Gist_VirtualMachineScaleSets.csx new file mode 100644 index 000000000..756f68142 --- /dev/null +++ b/data/templates/Gist_VirtualMachineScaleSets.csx @@ -0,0 +1,10 @@ +using System; +using System.Threading; + + +[ArmResourceFilter(provider: "Microsoft.Compute", resourceTypeName: "virtualMachineScaleSets")] +[Definition(Id = "", Name = "", Author = "", Description = "")] +public static class +{ + +}