From 125aaf1a9d6c723e30642248e52893bc2bd66b1d Mon Sep 17 00:00:00 2001 From: John Duprey Date: Thu, 3 Oct 2024 17:58:10 -0400 Subject: [PATCH] Cleanup triggers --- .../function.json | 0 Modules/CippEntrypoints/CippEntrypoints.psm1 | 34 +------------------ Z_CIPPQueueTrigger/function.json | 17 ---------- 3 files changed, 1 insertion(+), 50 deletions(-) rename {Z_CIPPHttpTrigger => CIPPHttpTrigger}/function.json (100%) delete mode 100644 Z_CIPPQueueTrigger/function.json diff --git a/Z_CIPPHttpTrigger/function.json b/CIPPHttpTrigger/function.json similarity index 100% rename from Z_CIPPHttpTrigger/function.json rename to CIPPHttpTrigger/function.json diff --git a/Modules/CippEntrypoints/CippEntrypoints.psm1 b/Modules/CippEntrypoints/CippEntrypoints.psm1 index 6286b64246f0..1bda0cce5b84 100644 --- a/Modules/CippEntrypoints/CippEntrypoints.psm1 +++ b/Modules/CippEntrypoints/CippEntrypoints.psm1 @@ -57,38 +57,6 @@ function Receive-CippHttpTrigger { } } -function Receive-CippQueueTrigger { - Param($QueueItem, $TriggerMetadata) - - Set-Location (Get-Item $PSScriptRoot).Parent.Parent.FullName - $Start = (Get-Date).ToUniversalTime() - $APIName = $TriggerMetadata.FunctionName - Write-Information "#### Running $APINAME" - Set-Location (Get-Item $PSScriptRoot).Parent.Parent.FullName - $FunctionName = 'Push-{0}' -f $APIName - $QueueTrigger = @{ - QueueItem = $QueueItem - TriggerMetadata = $TriggerMetadata - } - try { - & $FunctionName @QueueTrigger - } catch { - $ErrorMsg = $_.Exception.Message - } - - $End = (Get-Date).ToUniversalTime() - - $Stats = @{ - FunctionType = 'Queue' - Entity = $QueueItem - Start = $Start - End = $End - ErrorMsg = $ErrorMsg - } - Write-Information '####### Adding stats' - Write-CippFunctionStats @Stats -} - function Receive-CippOrchestrationTrigger { param($Context) @@ -267,5 +235,5 @@ function Receive-CIPPTimerTrigger { } } -Export-ModuleMember -Function @('Receive-CippHttpTrigger', 'Receive-CippQueueTrigger', 'Receive-CippOrchestrationTrigger', 'Receive-CippActivityTrigger', 'Receive-CIPPTimerTrigger') +Export-ModuleMember -Function @('Receive-CippHttpTrigger', 'Receive-CippOrchestrationTrigger', 'Receive-CippActivityTrigger', 'Receive-CIPPTimerTrigger') diff --git a/Z_CIPPQueueTrigger/function.json b/Z_CIPPQueueTrigger/function.json deleted file mode 100644 index 7f7dde0a4cbd..000000000000 --- a/Z_CIPPQueueTrigger/function.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "scriptFile": "../Modules/CippEntrypoints/CippEntrypoints.psm1", - "entryPoint": "Receive-CippQueueTrigger", - "bindings": [ - { - "name": "QueueItem", - "type": "queueTrigger", - "direction": "in", - "queueName": "CIPPGenericQueue" - }, - { - "name": "starter", - "type": "durableClient", - "direction": "in" - } - ] -}