-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use Disable-AzSentinelAlertRule or Enable-AzSentinelAlertRule #84
Comments
Hoping this was a simple one, but changing AzSentinel/Public/Disable-AzSentinelAlertRule.ps1:63-65 $bodyAlertProp = [ScheduledAlertProp]::new(
($rule | Select-Object * -ExcludeProperty lastModifiedUtc, etag, id)
) The subsequent errors: MethodException: /x/git/AZSentinel/AzSentinel/Public/Disable-AzSentinelAlertRule.ps1:66
Line |
66 | … @($rule | Select-Object * -ExcludeProperty lastModifiedUtc, …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot find an overload for "new" and the argument count: "1".
MethodException: /x/git/AZSentinel/AzSentinel/Public/Disable-AzSentinelAlertRule.ps1:69
Line |
69 | $body = [AlertRule]::new(
| ~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot find an overload for "new" and the argument count: "2". |
I am cross the same situation. I am sure works before last commit. |
I haven't been able to get this working either. Currently on 0.6.10 Get-Command -Module AzSentinel Disable-AzSentinelAlertRule
CommandType Name Version Source
----------- ---- ------- ------
Function Disable-AzSentinelAlertRule 0.6.10 AzSentinel Get-Command -Module AzSentinel Enable-AzSentinelAlertRule
CommandType Name Version Source
----------- ---- ------- ------
Function Enable-AzSentinelAlertRule 0.6.10 AzSentinel Disable-AzSentinelAlertRule -WorkspaceName $Workspace -RuleName $RuleName -Verbose -Debug
<SNIP>
InvalidOperation: /Users/test/.local/share/powershell/Modules/AzSentinel/0.6.10/AzSentinel.psm1:3376
Line |
3376 | $bodyAlertProp = [AlertProp]::new(
| ~~~~~~~~~~~
| Unable to find type [AlertProp].
MethodException: /Users/test/.local/share/powershell/Modules/AzSentinel/0.6.10/AzSentinel.psm1:3380
Line |
3380 | $body = [AlertRule]::new(
| ~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot find an overload for "new" and the argument count: "2". |
@pemontto I know works before, because I running a script last week and works well. Yesterday i starting have the issues with disable the AlertRule |
For now you can have a look at your previous versions and rollback to a version that works Get-Module -ListAvailable AzSentinel Rollback Import-Module AzSentinel -RequiredVersion "0.6.8" -Force |
I am try using the 0.6.10, 0.6.8 and 0.6.5 and I still have same error. Disable-AzSentinelAlertRule -SubscriptionId $SubscriptionId -WorkspaceName $WorkspaceName -RuleName $RuleName InvalidOperation: C:\Users\user\Documents\PowerShell\Modules\AzSentinel\0.6.5\AzSentinel.psm1:644 MethodException: C:\Users\user\Documents\PowerShell\Modules\AzSentinel\0.6.5\AzSentinel.psm1:648 Disable-AzSentinelAlertRule: Response status code does not indicate success: 400 (Bad Request). |
@rleal124 thanks for the feedback, I see what's broken. Already fixed the issue for disable and enable function. Will merge this. |
@pkhabazi Thanks for your feedback. |
@pkhabazi Thanks, I tested now and works well. Many thanks for your support. |
Environment
Steps to reproduce
Attempt to disable a scheduled rule that is currently enabled.
Expected behavior
The rule gets disabled.
Actual behavior
The command produces errors when, I'm guessing, it tries to build the Scheduled Alert rule object:
The text was updated successfully, but these errors were encountered: