Closed BartDecker closed 1 year ago
Hi @NoriZC please look into this when you got time, thanks.
Hi @BartDecker,
Az.Monitor 3.1.0 is a relatively old version. It called CreateOrUpdate api and the api version is 2018-04-16.
Our current version is 4.6.0, where the api version is 2021-08-01. We are not supporting 2023-03-15-preview as git workflow. If you want to keep the same api version, you can call New-AzScheduledQueryRule to create the alert. If you need the api version to be exactly 2023-03-15-preview for some reason, could you please explain more about how will this property effect you? Like what's the gap between v1 and v2 alerts?
Appreciate if you are willing to try newer version of Monitor. Please run Install-Module Az.Monitor -Repository PSGallery -AllowClobber
and refer to Update-AzScheduledQueryRule.
@NoriZC thanks for your feedback. I see I skipped some steps in my testing. I was not aware of a new cmdlet being available for updating the alert. I will use that one to do what I need to do instead of the old cmdlet.
Description
Set-AzScheduledQueryRule reverts alert rule back to V1
Example scenario:
We deploy our alert rules by a git workflow. Sometimes we afterwards update the description of the deployed alerts using Set-AzScheduledQueryRule
Before the action it's a v2 alert, after the action it's a v1 alert. The "createdWithApiVersion" in the json changes from
"createdWithApiVersion": "2023-03-15-preview"
to
"createdWithApiVersion": "2018-04-16",
Issue script & Debug output
Environment data
Module versions
Error output