Azure / Azure/azure-cli

az monitor app-insights query: -a argument doesn't work with GUID when resource group is specified

Open
#26,574 6 comments 0 reactions 1 assignee Claimed by @AllyW View on GitHub
act-observability-squad Auto-Assign Auto-Resolve bug customer-reported Monitor Monitor - ApplicationInsights question Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### Describe the bug

Using the command

`az monitor app-insights query -a "GUID" -g "MyResourceGroup" `

Is resulting in **resource not found** but it works when I specify the app insight name
Without resource group name it works with GUID

### Related command

az monitor app-insights query -a "GUID" -g "MyResourceGroup"

### Errors

Resource Not Found

### Issue script & Debug output

2023-05-31T14:30:17.7779274Z ERROR: (ResourceNotFound)

### Expected behavior

Resource found

### Environment Summary

2023-05-31T14:29:13.5282467Z azure-cli 2.48.1 *
2023-05-31T14:29:13.5288488Z
2023-05-31T14:29:13.5366054Z core 2.48.1 *
2023-05-31T14:29:13.5396371Z telemetry 1.0.8
2023-05-31T14:29:13.5712027Z
2023-05-31T14:29:13.5716902Z Extensions:
2023-05-31T14:29:13.5723454Z azure-devops 0.26.0
2023-05-31T14:29:13.5725391Z
2023-05-31T14:29:13.5727305Z Dependencies:
2023-05-31T14:29:13.5729557Z msal 1.20.0
2023-05-31T14:29:13.5731757Z azure-mgmt-resource 22.0.0

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.