Skip to content

Commit

Permalink
Merge pull request #1221 from Ren-Roros-Digital/Quarantine
Browse files Browse the repository at this point in the history
fix: repair Quarantine Management
  • Loading branch information
KelvinTegelaar authored Jan 14, 2025
2 parents 6d7962f + a75a37a commit b6a6d04
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Function Invoke-ExecQuarantineManagement {
param($Request, $TriggerMetadata)

$APIName = $TriggerMetadata.FunctionName
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -message 'Accessed this API' -Sev 'Debug'
Write-LogMessage -user $Request.headers.'x-ms-client-principal' -API $APINAME -message 'Accessed this API' -Sev 'Debug'


# Write to the Azure Functions log stream.
Expand All @@ -20,19 +20,19 @@ Function Invoke-ExecQuarantineManagement {

# Interact with query parameters or the body of the request.
Try {
$tenantfilter = $Request.Query.TenantFilter
$TenantFilter = $Request.Body.tenantFilter
$params = @{
Identity = $request.query.ID
AllowSender = [boolean]$Request.query.AllowSender
ReleasetoAll = [boolean]$Request.query.type
ActionType = $Request.query.type
Identity = $Request.Body.Identity
AllowSender = [boolean]$Request.Body.AllowSender
ReleaseToAll = [boolean]$Request.Body.Type
ActionType = $Request.Body.Type
}
Write-Host $params

New-ExoRequest -tenantid $TenantFilter -cmdlet 'Release-QuarantineMessage' -cmdParams $Params
$Results = [pscustomobject]@{'Results' = "Successfully processed $($request.query.ID)" }
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -tenant $($tenantfilter) -message "$($request.query.id)" -Sev 'Info'
$Results = [pscustomobject]@{'Results' = "Successfully processed $($Request.Body.Identity)" }
Write-LogMessage -user $Request.headers.'x-ms-client-principal' -API $APINAME -tenant $TenantFilter -message "Successfully processed Quarantine ID $($Request.Body.Identity)" -Sev 'Info'
} catch {
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -tenant $($tenantfilter) -message "Quarantine Management failed: $($_.Exception.Message)" -Sev 'Error'
Write-LogMessage -user $Request.headers.'x-ms-client-principal' -API $APINAME -tenant $TenantFilter -message "Quarantine Management failed: $($_.Exception.Message)" -Sev 'Error' -LogData $_
$Results = [pscustomobject]@{'Results' = "Failed. $($_.Exception.Message)" }
}
# Associate values to output bindings by calling 'Push-OutputBinding'.
Expand Down

0 comments on commit b6a6d04

Please sign in to comment.