File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
Entrypoints/HTTP Functions Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,21 @@ function New-CippCoreRequest {
1515 $FunctionName = ' Invoke-{0}' -f $Request.Params.CIPPEndpoint
1616 Write-Information " API Endpoint: $ ( $Request.Params.CIPPEndpoint ) | Frontend Version: $ ( $Request.Headers .' X-CIPP-Version' ?? ' Not specified' ) "
1717
18+ if ($Request.Headers .' X-CIPP-Version' ) {
19+ $Table = Get-CippTable - tablename ' Version'
20+ $FrontendVer = Get-CIPPAzDataTableEntity @Table - Filter " PartitionKey eq 'Version' and RowKey eq 'frontend'"
21+
22+ if (! $FrontendVer -or ([semver ]$FrontendVer.Version -lt [semver ]$Request.Headers .' X-CIPP-Version' )) {
23+ Add-CIPPAzDataTableEntity @Table - Entity ([pscustomobject ]@ {
24+ PartitionKey = ' Version'
25+ RowKey = ' frontend'
26+ Version = $Request.Headers .' X-CIPP-Version'
27+ }) - Force
28+ } elseif ([semver ]$FrontendVer.Version -gt [semver ]$Request.Headers .' X-CIPP-Version' ) {
29+ Write-Warning " Client version $ ( $Request.Headers .' X-CIPP-Version' ) is older than the current frontend version $ ( $FrontendVer.Version ) "
30+ }
31+ }
32+
1833 $HttpTrigger = @ {
1934 Request = [pscustomobject ]($Request )
2035 TriggerMetadata = $TriggerMetadata
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ function Get-CIPPTimerFunctions {
1010
1111 # Check running nodes
1212 $VersionTable = Get-CIPPTable - tablename ' Version'
13- $Nodes = Get-CIPPAzDataTableEntity @VersionTable - Filter " PartitionKey eq 'Version' and RowKey ne 'Version'"
13+ $Nodes = Get-CIPPAzDataTableEntity @VersionTable - Filter " PartitionKey eq 'Version' and RowKey ne 'Version' and RowKey ne 'frontend' "
1414
1515 $FunctionName = $env: WEBSITE_SITE_NAME
1616 $MainFunctionVersion = ($Nodes | Where-Object { $_.RowKey -eq $FunctionName }).Version
You can’t perform that action at this time.
0 commit comments