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 metrics alert create - scope for failedLocationCount #6274

Open
Gholie opened this issue May 10, 2023 · 4 comments
Open

az monitor metrics alert create - scope for failedLocationCount #6274

Gholie opened this issue May 10, 2023 · 4 comments
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. feature-request This issue requires a new behavior in the product in order be resolved. Monitor - Metrics Monitor
Milestone

Comments

@Gholie
Copy link

Gholie commented May 10, 2023

  • If the issue is to do with Azure CLI 2.0 in-particular, create an issue here at Azure/azure-cli

Related command

$result = az monitor metrics alert create `
            --name $AlertName `
            --subscription $SubscriptionId `
            --resource-group $ResourceGroup `
            --description $AlertDescription `
            --severity $AlertSeverity `
            --scopes $scope `
            --condition $condition `
            --evaluation-frequency $evaluationFrequency `
            --window-size $WindowSizeInMinutes `
            --auto-mitigate $true `
            @actionGroup | ConvertFrom-Json

Extension name (the extension in question)

monitor metrics alert

Description of issue (in as much detail as possible)

I am trying to create a alert for a Application Insight web test which should have failedLocationCount as trigger. Doing this in the portal gives a resource scope that looks like this:

"scopes": [
            "/subscriptions/SubscriptionId/resourcegroups/ResourceGroup/providers/microsoft.insights/webtests/webTestName",
            "/subscriptions/SubscriptionId/resourcegroups/ResourceGroup/providers/microsoft.insights/components/componentName"
        ],

Dimension in manual create:

"criteria": {
            "failedLocationCount": 2,
            "webTestId": "/subscriptions/subscriptions/SubscriptionId/resourcegroups/ResourceGroup/providers/microsoft.insights/webtests/webTestName",
            "componentId": "/subscriptions/subscriptions/SubscriptionId/resourcegroups/ResourceGroup/providers/microsoft.insights/components/componentName",
            "odata.type": "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria"

Dimension in Az Cli: "count failedLocationCount > 2"
Scope in Az Cli:

/subscriptions/subscriptions/SubscriptionId/resourcegroups/ResourceGroup/providers/microsoft.insights/webtests/webtestName
/subscriptions/subscriptions/SubscriptionId/resourcegroups/ResourceGroup/providers/microsoft.insights/components/componentName

When trying to replicate this with Azure Cli I get the following error:
ERROR: Multiple scopes should be the same resource type.

When only doing one of the scopes I get the following:
{"code":"BadRequest","message":"microsoft.insights/webtests is not a supported platform metric namespace

Or

ERROR: (BadRequest) Couldn't find a metric named failedLocationCount. Make sure the name is correct. Activity ID: <id>
Code: BadRequest

What would be the correct format for Scope?

@ghost ghost 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 May 10, 2023
@yonzhan
Copy link
Collaborator

yonzhan commented May 10, 2023

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

@ghost ghost assigned AllyW May 10, 2023
@ghost ghost added this to the Backlog milestone May 10, 2023
@ghost ghost added the Azure CLI Team The command of the issue is owned by Azure CLI team label May 10, 2023
@Gholie
Copy link
Author

Gholie commented May 30, 2023

Any updates on this?

@yonzhan yonzhan added feature-request This issue requires a new behavior in the product in order be resolved. and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jun 5, 2023
@Gholie
Copy link
Author

Gholie commented Aug 3, 2023

Hi, any updates? :)

@AllyW
Copy link
Member

AllyW commented Nov 8, 2023

@Gholie request error forwarded to service team

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. feature-request This issue requires a new behavior in the product in order be resolved. Monitor - Metrics Monitor
Projects
None yet
Development

No branches or pull requests

3 participants