Skip to content

Commit 33f979a

Browse files
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into dev
2 parents cb01749 + be2916d commit 33f979a

File tree

1 file changed

+43
-2
lines changed

1 file changed

+43
-2
lines changed

Modules/CippEntrypoints/CippEntrypoints.psm1

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@ using namespace System.Net
22

33
function Receive-CippHttpTrigger {
44
<#
5+
.SYNOPSIS
6+
Execute HTTP trigger function
7+
.DESCRIPTION
8+
Execute HTTP trigger function from an azure function app
9+
.PARAMETER Request
10+
The request object from the function app
11+
.PARAMETER TriggerMetadata
12+
The trigger metadata object from the function app
513
.FUNCTIONALITY
6-
Entrypoint
14+
Entrypoint
715
#>
816
Param(
917
$Request,
@@ -62,8 +70,18 @@ function Receive-CippHttpTrigger {
6270
}
6371

6472
function Receive-CippOrchestrationTrigger {
73+
<#
74+
.SYNOPSIS
75+
Execute durable orchestrator function
76+
.DESCRIPTION
77+
Execute orchestrator from azure function app
78+
.PARAMETER Context
79+
The context object from the function app
80+
.FUNCTIONALITY
81+
Entrypoint
82+
#>
6583
param($Context)
66-
84+
6785
try {
6886
if (Test-Json -Json $Context.Input) {
6987
$OrchestratorInput = $Context.Input | ConvertFrom-Json
@@ -129,9 +147,20 @@ function Receive-CippOrchestrationTrigger {
129147
} catch {
130148
Write-Information "Orchestrator error $($_.Exception.Message) line $($_.InvocationInfo.ScriptLineNumber)"
131149
}
150+
return $true
132151
}
133152

134153
function Receive-CippActivityTrigger {
154+
<#
155+
.SYNOPSIS
156+
Execute durable activity function
157+
.DESCRIPTION
158+
Execute durable activity function from an orchestrator
159+
.PARAMETER Item
160+
The item to process
161+
.FUNCTIONALITY
162+
Entrypoint
163+
#>
135164
Param($Item)
136165
Write-Warning "Hey Boo, the activity function is running. Here's some info: $($Item | ConvertTo-Json -Depth 10 -Compress)"
137166
try {
@@ -201,9 +230,20 @@ function Receive-CippActivityTrigger {
201230
$null = Set-CippQueueTask @QueueTask
202231
}
203232
}
233+
return $true
204234
}
205235

206236
function Receive-CIPPTimerTrigger {
237+
<#
238+
.SYNOPSIS
239+
This function is used to execute timer functions based on the cron schedule.
240+
.DESCRIPTION
241+
This function is used to execute timer functions based on the cron schedule.
242+
.PARAMETER Timer
243+
The timer trigger object from the function app
244+
.FUNCTIONALITY
245+
Entrypoint
246+
#>
207247
param($Timer)
208248

209249
$UtcNow = (Get-Date).ToUniversalTime()
@@ -257,6 +297,7 @@ function Receive-CIPPTimerTrigger {
257297

258298
Add-CIPPAzDataTableEntity @Table -Entity $FunctionStatus -Force
259299
}
300+
return $true
260301
}
261302

262303
Export-ModuleMember -Function @('Receive-CippHttpTrigger', 'Receive-CippOrchestrationTrigger', 'Receive-CippActivityTrigger', 'Receive-CIPPTimerTrigger')

0 commit comments

Comments
 (0)