File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed
Entrypoints/HTTP Functions Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ function New-CippCoreRequest {
2121 }
2222
2323 if ($PSCmdlet.ShouldProcess (" Processing request for $ ( $Request.Params.CIPPEndpoint ) " )) {
24+ # Set script scope variables for Graph API to indicate HTTP request/high priority
25+ $script :XMsThrottlePriority = ' high'
26+
2427 if ((Get-Command - Name $FunctionName - ErrorAction SilentlyContinue) -or $FunctionName -eq ' Invoke-Me' ) {
2528 try {
2629 $Access = Test-CIPPAccess - Request $Request
Original file line number Diff line number Diff line change @@ -17,6 +17,10 @@ function New-GraphBulkRequest {
1717 if ($NoAuthCheck -or (Get-AuthorisedRequest - Uri $uri - TenantID $tenantid )) {
1818 $headers = Get-GraphToken - tenantid $tenantid - scope $scope - AsApp $asapp
1919
20+ if ($script :XMsThrottlePriority ) {
21+ $headers [' x-ms-throttle-priority' ] = $script :XMsThrottlePriority
22+ }
23+
2024 $URL = " https://graph.microsoft.com/$Version /`$ batch"
2125
2226 # Track consecutive Graph API failures
Original file line number Diff line number Diff line change @@ -36,6 +36,11 @@ function New-GraphGetRequest {
3636 if ($ComplexFilter ) {
3737 $headers [' ConsistencyLevel' ] = ' eventual'
3838 }
39+
40+ if ($script :XMsThrottlePriority ) {
41+ $headers [' x-ms-throttle-priority' ] = $script :XMsThrottlePriority
42+ }
43+
3944 $nextURL = $uri
4045 if ($extraHeaders ) {
4146 foreach ($key in $extraHeaders.Keys ) {
You can’t perform that action at this time.
0 commit comments