Skip to content

Commit

Permalink
Merge pull request #1044 from JohnDuprey/dev
Browse files Browse the repository at this point in the history
Clean up duplicate webhook entries
  • Loading branch information
JohnDuprey authored Aug 2, 2024
2 parents 43b78c4 + 2c9b470 commit 9077bc6
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ function Push-Schedulerwebhookcreation {
if ($Row.tenantid -ne 'AllTenants') {
Remove-AzDataTableEntity @Table -Entity $Row
}
if (($Webhook | Measure-Object).Count -gt 1) {
$Webhook = $Webhook | Select-Object -First 1
$WebhooksToRemove = $ExistingWebhooks | Where-Object { $_.RowKey -ne $Webhook.RowKey }
foreach ($RemoveWebhook in $WebhooksToRemove) {
Remove-AzDataTableEntity @WebhookTable -Entity $RemoveWebhook
}
}
} else {
Write-Information "No existing webhook for $Tenant - $($Row.webhookType) - Time to create."
try {
Expand Down

0 comments on commit 9077bc6

Please sign in to comment.