r

    rich-kilobyte-15539

    7 months ago
    Hi everyone, I have a question regarding the ScheduledAlertRule, I would like to create the scheduled alert rule without workspace. Is that possible ? Because currently the workspaceName is a mandatory field in the Input. I was able to create the following rule in console without needing the workspace. Thank you for reading 😄
    l

    little-cartoon-10569

    7 months ago
    Here's the Azure API on which the Pulumi API is based. The workspaceName field is not optional, apparently.
    r

    rich-kilobyte-15539

    7 months ago
    @little-cartoon-10569 thanks for the impromptu reply 😄 ! However, I kept on having this issue, have been searching around but still couldn't resolve this.
    error: autorest/azure: Service returned an error. Status=404 Code="NotFound" Message="{\"error\":{\"code\":\"NotFound\",\"message\":\"Couldn't find workspaceMetadata of workspace id a30b9da9-9fcb-4c38-8259-ec7001823d12\"
    Heh.. I forgot to include the link earlier 🙂
    I'm afraid I don't know anything about Azure and workspace metadata. Have you pinged the #azure channel?
    r

    rich-kilobyte-15539

    7 months ago
    I were able to create the scheduled-query rules without needing a workspace which can be seen here https://docs.microsoft.com/en-us/azure/azure-monitor/alerts/alerts-log Why does the Pulumi API require it ?
    az monitor scheduled-query create -g {ResourceGroup} -n {nameofthealert} --scopes {vm_id} --condition "count \'union Event, Syslog | where TimeGenerated > ago(1h) | where EventLevelName == \"Error\" or SeverityLevel== \"err\"\' > 2" --description {descriptionofthealert}