From a9b347507209ca028fa6078c95535359bc6d114c Mon Sep 17 00:00:00 2001 From: anandanthony Date: Thu, 3 Mar 2022 01:16:18 +0530 Subject: [PATCH 1/3] Create Detector_VirtualMachineScaleSets.csx adding template file for detectors --- .../Detector_VirtualMachineScaleSets.csx | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 data/templates/Detector_VirtualMachineScaleSets.csx 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; +} From 0ad402cde3d4ad72ad8f63a30dc4daed1310b964 Mon Sep 17 00:00:00 2001 From: anandanthony Date: Thu, 3 Mar 2022 01:18:20 +0530 Subject: [PATCH 2/3] Create Gist_VirtualMachineScaleSets.csx adding gist template file for VMSS --- data/templates/Gist_VirtualMachineScaleSets.csx | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 data/templates/Gist_VirtualMachineScaleSets.csx diff --git a/data/templates/Gist_VirtualMachineScaleSets.csx b/data/templates/Gist_VirtualMachineScaleSets.csx new file mode 100644 index 000000000..1c595eed1 --- /dev/null +++ b/data/templates/Gist_VirtualMachineScaleSets.csx @@ -0,0 +1,10 @@ +using System; +using System.Threading; + + +[ArmResourceFilter(provider: "Microsoft.Compute", resourceTypeName: "virtualMachines")] +[Definition(Id = "", Name = "", Author = "", Description = "")] +public static class +{ + +} From e1ac9380a6cdd8ebc592d69f1a74a85f1e8d483f Mon Sep 17 00:00:00 2001 From: anandanthony Date: Thu, 3 Mar 2022 01:53:51 +0530 Subject: [PATCH 3/3] Update Gist_VirtualMachineScaleSets.csx --- data/templates/Gist_VirtualMachineScaleSets.csx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/templates/Gist_VirtualMachineScaleSets.csx b/data/templates/Gist_VirtualMachineScaleSets.csx index 1c595eed1..756f68142 100644 --- a/data/templates/Gist_VirtualMachineScaleSets.csx +++ b/data/templates/Gist_VirtualMachineScaleSets.csx @@ -2,7 +2,7 @@ using System; using System.Threading; -[ArmResourceFilter(provider: "Microsoft.Compute", resourceTypeName: "virtualMachines")] +[ArmResourceFilter(provider: "Microsoft.Compute", resourceTypeName: "virtualMachineScaleSets")] [Definition(Id = "", Name = "", Author = "", Description = "")] public static class {