Skip to content

Commit 5250fc3

Browse files
committed
fix: Update environment variable retrieval for orchestrator and offload function triggers
1 parent 852a72d commit 5250fc3

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Modules/CIPPCore/Public/Entrypoints/Orchestrator Functions/Start-CIPPOrchestrator.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function Start-CIPPOrchestrator {
3838
# If already running in processor context (e.g., timer trigger) and we have an InputObject,
3939
# start orchestration directly without queuing
4040

41-
$OrchestratorTriggerDisabled = $env:AzureWebJobs_CIPPOrchestrator_Disabled -eq 'true' -or $env:AzureWebJobs_CIPPOrchestrator_Disabled -eq '1'
41+
$OrchestratorTriggerDisabled = $env:AzureWebJobs_CIPPOrchestrator_Disabled -in @('true', '1') -or [System.Environment]::GetEnvironmentVariable('AzureWebJobs.CIPPOrchestrator.Disabled') -in @('true', '1')
4242

4343
if ($InputObject -and -not $OrchestratorTriggerDisabled) {
4444
Write-Information 'Running in processor context - starting orchestration directly'

Modules/CIPPCore/Public/GraphHelper/Set-CIPPOffloadFunctionTriggers.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function Set-CIPPOffloadFunctionTriggers {
6565
$SettingKey = "AzureWebJobs.$Trigger.Disabled"
6666
# Convert setting key to environment variable format (dots become underscores)
6767
$EnvVarName = $SettingKey -replace '\.', '_'
68-
$CurrentValue = [System.Environment]::GetEnvironmentVariable($EnvVarName)
68+
$CurrentValue = [System.Environment]::GetEnvironmentVariable($SettingKey) ?? [System.Environment]::GetEnvironmentVariable($EnvVarName)
6969

7070
if ($CurrentValue -eq '1') {
7171
Write-Verbose "Skipping $SettingKey - already set to 1"
@@ -96,7 +96,7 @@ function Set-CIPPOffloadFunctionTriggers {
9696
$SettingKey = "AzureWebJobs.$Trigger.Disabled"
9797
# Convert setting key to environment variable format (dots become underscores)
9898
$EnvVarName = $SettingKey -replace '\.', '_'
99-
$CurrentValue = [System.Environment]::GetEnvironmentVariable($EnvVarName)
99+
$CurrentValue = [System.Environment]::GetEnvironmentVariable($SettingKey) ?? [System.Environment]::GetEnvironmentVariable($EnvVarName)
100100

101101
if ([string]::IsNullOrEmpty($CurrentValue) -or $CurrentValue -ne '1') {
102102
Write-Verbose "Skipping $SettingKey - already enabled or not set"

0 commit comments

Comments
 (0)