Skip to content

Commit

Permalink
Merge branch 'KelvinTegelaar:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
CentralizedServices authored Mar 28, 2024
2 parents bf98514 + 64cfeb3 commit 840f6df
Show file tree
Hide file tree
Showing 123 changed files with 1,210 additions and 1,088 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/dev_cippckdtz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build and deploy Powershell project to Azure Function App - cippckdtz

on:
push:
branches:
- dev
workflow_dispatch:

env:
AZURE_FUNCTIONAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root

jobs:
deploy:
runs-on: windows-latest

steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v4

- name: 'Run Azure Functions Action'
uses: Azure/functions-action@v1
id: fa
with:
app-name: 'cippckdtz'
slot-name: 'Production'
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_2101C7175BFB47E58240ABD1E72E81C2 }}
2 changes: 1 addition & 1 deletion BestPracticeAnalyser_Orchestration/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ param($Context)

$DurableRetryOptions = @{
FirstRetryInterval = (New-TimeSpan -Seconds 5)
MaxNumberOfAttempts = 3
MaxNumberOfAttempts = 1
BackoffCoefficient = 2
}
$RetryOptions = New-DurableRetryOptions @DurableRetryOptions
Expand Down
1 change: 1 addition & 0 deletions DomainAnalyser_All/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ $Result = [PSCustomObject]@{
GUID = $($Domain.Replace('.', ''))
LastRefresh = $(Get-Date (Get-Date).ToUniversalTime() -UFormat '+%Y-%m-%dT%H:%M:%S.000Z')
Domain = $Domain
NSRecords = (Read-NSRecord -Domain $Domain).Records
ExpectedSPFRecord = ''
ActualSPFRecord = ''
SPFPassAll = ''
Expand Down
70 changes: 33 additions & 37 deletions DomainAnalyser_Orchestration/run.ps1
Original file line number Diff line number Diff line change
@@ -1,44 +1,40 @@
param($Context)

try {
try {

$DurableRetryOptions = @{
FirstRetryInterval = (New-TimeSpan -Seconds 5)
MaxNumberOfAttempts = 3
BackoffCoefficient = 2
}
$RetryOptions = New-DurableRetryOptions @DurableRetryOptions
$DurableRetryOptions = @{
FirstRetryInterval = (New-TimeSpan -Seconds 5)
MaxNumberOfAttempts = 1
BackoffCoefficient = 2
}
$RetryOptions = New-DurableRetryOptions @DurableRetryOptions

# Sync tenants
try {
Invoke-ActivityFunction -FunctionName 'DomainAnalyser_GetTenantDomains' -Input 'Tenants'
}
catch { Write-Host "EXCEPTION: TenantDomains $($_.Exception.Message)" }
# Sync tenants
try {
Invoke-ActivityFunction -FunctionName 'DomainAnalyser_GetTenantDomains' -Input 'Tenants'
} catch { Write-Host "EXCEPTION: TenantDomains $($_.Exception.Message)" }

# Get list of all domains to process
$Batch = Invoke-ActivityFunction -FunctionName 'Activity_GetAllTableRows' -Input 'Domains'

$ParallelTasks = foreach ($Item in $Batch) {
Invoke-DurableActivity -FunctionName 'DomainAnalyser_All' -Input $item -NoWait -RetryOptions $RetryOptions
}

# Collect activity function results and send to database
$TableParams = Get-CippTable -tablename 'Domains'
$TableParams.Entity = Wait-ActivityFunction -Task $ParallelTasks
$TableParams.Force = $true
$TableParams = $TableParams | ConvertTo-Json -Compress
# Get list of all domains to process
$Batch = Invoke-ActivityFunction -FunctionName 'Activity_GetAllTableRows' -Input 'Domains'

try {
Invoke-ActivityFunction -FunctionName 'Activity_AddOrUpdateTableRows' -Input $TableParams
}
catch {
Write-Host "Orchestrator exception UpdateDomains $($_.Exception.Message)"
}
}
catch {
Write-LogMessage -API 'DomainAnalyser' -message "Domain Analyser Orchestrator Error $($_.Exception.Message)" -sev info
#Write-Host $_.Exception | ConvertTo-Json
}
finally {
Write-LogMessage -API 'DomainAnalyser' -message 'Domain Analyser has Finished' -sev Info
$ParallelTasks = foreach ($Item in $Batch) {
Invoke-DurableActivity -FunctionName 'DomainAnalyser_All' -Input $item -NoWait -RetryOptions $RetryOptions
}

# Collect activity function results and send to database
$TableParams = Get-CippTable -tablename 'Domains'
$TableParams.Entity = Wait-ActivityFunction -Task $ParallelTasks
$TableParams.Force = $true
$TableParams = $TableParams | ConvertTo-Json -Compress

try {
Invoke-ActivityFunction -FunctionName 'Activity_AddOrUpdateTableRows' -Input $TableParams
} catch {
Write-Host "Orchestrator exception UpdateDomains $($_.Exception.Message)"
}
} catch {
Write-LogMessage -API 'DomainAnalyser' -message "Domain Analyser Orchestrator Error $($_.Exception.Message)" -sev info
#Write-Host $_.Exception | ConvertTo-Json
} finally {
Write-LogMessage -API 'DomainAnalyser' -message 'Domain Analyser has Finished' -sev Info
}
16 changes: 0 additions & 16 deletions ExecExtensionNinjaOneQueue/function.json

This file was deleted.

13 changes: 0 additions & 13 deletions ExecExtensionNinjaOneQueue/run.ps1

This file was deleted.

7 changes: 3 additions & 4 deletions ExecGDAPInviteApproved_Timer/function.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
"schedule": "0 0 */3 * * *"
},
{
"type": "queue",
"direction": "out",
"name": "gdapinvitequeue",
"queueName": "gdapinvitequeue"
"name": "starter",
"type": "durableClient",
"direction": "in"
}
]
}
10 changes: 0 additions & 10 deletions ExecGDAPInviteQueue/function.json

This file was deleted.

7 changes: 0 additions & 7 deletions ExecGDAPInviteQueue/run.ps1

This file was deleted.

10 changes: 0 additions & 10 deletions ExecScheduledCommand/function.json

This file was deleted.

83 changes: 0 additions & 83 deletions ExecScheduledCommand/run.ps1

This file was deleted.

10 changes: 0 additions & 10 deletions ListLicensesAllTenants/function.json

This file was deleted.

28 changes: 0 additions & 28 deletions ListLicensesAllTenants/run.ps1

This file was deleted.

10 changes: 0 additions & 10 deletions ListMFAUsersAllTenants/function.json

This file was deleted.

57 changes: 0 additions & 57 deletions ListMFAUsersAllTenants/run.ps1

This file was deleted.

Loading

0 comments on commit 840f6df

Please sign in to comment.