File tree Expand file tree Collapse file tree 2 files changed +55
-1
lines changed
Modules/CIPPCore/Public/Entrypoints/Timer Functions Expand file tree Collapse file tree 2 files changed +55
-1
lines changed Original file line number Diff line number Diff line change 1+ # Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
2+ # More GitHub Actions for Azure: https://github.com/Azure/actions
3+
4+ name : Build and deploy Powershell project to Azure Function App - cipp23l35
5+
6+ on :
7+ push :
8+ branches :
9+ - dev
10+ workflow_dispatch :
11+
12+ env :
13+ AZURE_FUNCTIONAPP_PACKAGE_PATH : ' .' # set this to the path to your web app project, defaults to the repository root
14+
15+ jobs :
16+ deploy :
17+ runs-on : ubuntu-latest
18+
19+ steps :
20+ - name : ' Checkout GitHub Action'
21+ uses : actions/checkout@v4
22+
23+ - name : ' Run Azure Functions Action'
24+ uses : Azure/functions-action@v1
25+ id : fa
26+ with :
27+ app-name : ' cipp23l35'
28+ slot-name : ' Production'
29+ package : ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
30+ publish-profile : ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_8891846CC18E45F9B6795F5DD41640ED }}
31+ sku : ' flexconsumption'
32+
Original file line number Diff line number Diff line change @@ -24,7 +24,29 @@ function Start-CIPPProcessorQueue {
2424 }
2525 if (Get-Command - Name $FunctionName - ErrorAction SilentlyContinue) {
2626 try {
27- Invoke-Command - ScriptBlock { & $FunctionName @Parameters }
27+ # Prepare telemetry metadata
28+ $metadata = @ {
29+ FunctionName = $FunctionName
30+ TriggerType = ' ProcessorQueue'
31+ QueueRowKey = $QueueItem.RowKey
32+ }
33+
34+ # Add parameters info if available
35+ if ($Parameters.Count -gt 0 ) {
36+ $metadata [' ParameterCount' ] = $Parameters.Count
37+ # Add common parameters
38+ if ($Parameters.Tenant ) {
39+ $metadata [' Tenant' ] = $Parameters.Tenant
40+ }
41+ if ($Parameters.TenantFilter ) {
42+ $metadata [' Tenant' ] = $Parameters.TenantFilter
43+ }
44+ }
45+
46+ # Wrap function execution with telemetry
47+ Measure-CippTask - TaskName $FunctionName - Metadata $metadata - Script {
48+ Invoke-Command - ScriptBlock { & $FunctionName @Parameters }
49+ }
2850 } catch {
2951 Write-Warning " Failed to run function $ ( $FunctionName ) . Error: $ ( $_.Exception.Message ) "
3052 }
You can’t perform that action at this time.
0 commit comments