Skip to content
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

az monitor scheduled-query create doesn't support an identity parameter #8364

Open
zoeperryman opened this issue Dec 11, 2024 · 1 comment
Open
Assignees
Labels
Auto-Assign Auto assign by bot Azure CLI Team The command of the issue is owned by Azure CLI team customer-reported Issues that are reported by GitHub users external to the Azure organization. Monitor question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Milestone

Comments

@zoeperryman
Copy link

Describe the bug

Attempting to create a scheduled query using a Azure Resource Graph query results in an error because there is no way to specify an identity.

Command Name
az monitor scheduled-query create Extension Name: scheduled-query. Version: 1.0.0b1.

Errors:

Code: BadRequest
Message: The 'adx' pattern cannot be used with the current authentication scheme. The request had some invalid properties Activity ID: d68240ec-44a7-4056-b84c-71793db58560.

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

Provide a query that accesses Azure Resource Graph (arg)

az monitor scheduled-query create -n {} -g {} --scopes {} --action-groups {} --severity {} --evaluation-frequency {} --window-size {} --auto-mitigate {} --description {} \
    --condition "count 'Placeholder_1' > 0 resource id vmResourceId" \
    --condition-query Placeholder_1="arg('').patchassessmentresources | where properties.status =~ 'Succeeded'  | extend securityOrCriticalUpdatesCount = iff(properties.osType =~ 'Windows', (toint(properties.availablePatchCountByClassification.security) + toint(properties.availablePatchCountByClassification.critical)), toint(properties.availablePatchCountByClassification.security)) | where securityOrCriticalUpdatesCount > 0 | extend vmResourceId = tostring(split(id, '/patchAssessmentResults/')[0]) | project vmResourceId" `

Expected Behavior

Command needs an additional parameter to specify the identity, which looks like it was added in version 2022-08-01-preview of the API.
https://learn.microsoft.com/en-us/azure/templates/microsoft.insights/change-log/scheduledqueryrules#2022-08-01-preview.

Other queries I've added via the cli command appear to be created using api version 2021-08-01

Environment Summary

Windows-11-10.0.22631-SP0
Python 3.12.7
Installer: MSI

azure-cli 2.67.0

Extensions:
datafactory 1.0.2
datamigration 1.0.0b2
maintenance 1.6.0
monitor-control-service 1.2.0
scheduled-query 1.0.0b1

Dependencies:
msal 1.31.0
azure-mgmt-resource 23.1.1

Additional Context

This is the option you get when creating via the portal:
Image

@yonzhan
Copy link
Collaborator

yonzhan commented Dec 11, 2024

Thank you for opening this issue, we will look into it.

@microsoft-github-policy-service microsoft-github-policy-service bot added question The issue doesn't require a change to the product in order to be resolved. Most issues start as that customer-reported Issues that are reported by GitHub users external to the Azure organization. Auto-Assign Auto assign by bot Monitor labels Dec 11, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Azure CLI Team The command of the issue is owned by Azure CLI team label Dec 11, 2024
@yonzhan yonzhan added this to the Backlog milestone Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot Azure CLI Team The command of the issue is owned by Azure CLI team customer-reported Issues that are reported by GitHub users external to the Azure organization. Monitor question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

3 participants