azure-cli-extensions icon indicating copy to clipboard operation
azure-cli-extensions copied to clipboard

az monitor app-insights with --output gives no output

Open cyclops1982 opened this issue 2 years ago • 5 comments

Describe the bug

az monitor app-insights with --output provides no output, while without --output it works fine.

Example command that works:

$ az monitor app-insights query -g resource -a name --analytics-query "requests | where url contains '.servicebus.windows.net/t_'" --start-time "2022-02-01" --offset 30d | wc -l
28629

Example that doesn't work

$ az monitor app-insights query -g resource -a name --analytics-query "requests | where url contains '.servicebus.windows.net/t_'" --start-time "2022-02-01" --offset 30d --output table | wc -l
1

Command Name az monitor app-insights query Extension Name: application-insights. Version: 0.1.15.

To Reproduce:

Run az monitor app-insights query with --output

Expected Behavior

Get output in the specified output

Environment Summary

Linux-5.10.0-11-amd64-x86_64-with-debian-11.2, Debian GNU/Linux 11 (bullseye)
Python 3.6.10
Installer: DEB

azure-cli 2.33.1

Extensions:
application-insights 0.1.15

Dependencies:
msal 1.16.0
azure-mgmt-resource 20.0.0

cyclops1982 avatar Feb 28 '22 15:02 cyclops1982

monitor

yonzhan avatar Feb 28 '22 23:02 yonzhan

Hi, 'az monitor app-insights query -- --output json/yaml 'works well , notice that when the query command with --output table has no results , the result will be in the form of blank. Best wishes.

YuanyuanNi avatar Mar 01 '22 08:03 YuanyuanNi

Thanks @YuanyuanNi I've noticed that --output table results in an empty result if there are no rows. I tested this with a query that /does/ provide a result, so i expect --table to NOT be empty...

cyclops1982 avatar Mar 01 '22 11:03 cyclops1982

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @SameergMS, @dadunl.

Issue Details

Describe the bug

az monitor app-insights with --output provides no output, while without --output it works fine.

Example command that works:

$ az monitor app-insights query -g resource -a name --analytics-query "requests | where url contains '.servicebus.windows.net/t_'" --start-time "2022-02-01" --offset 30d | wc -l
28629

Example that doesn't work

$ az monitor app-insights query -g resource -a name --analytics-query "requests | where url contains '.servicebus.windows.net/t_'" --start-time "2022-02-01" --offset 30d --output table | wc -l
1

Command Name az monitor app-insights query Extension Name: application-insights. Version: 0.1.15.

To Reproduce:

Run az monitor app-insights query with --output

Expected Behavior

Get output in the specified output

Environment Summary

Linux-5.10.0-11-amd64-x86_64-with-debian-11.2, Debian GNU/Linux 11 (bullseye)
Python 3.6.10
Installer: DEB

azure-cli 2.33.1

Extensions:
application-insights 0.1.15

Dependencies:
msal 1.16.0
azure-mgmt-resource 20.0.0
Author: cyclops1982
Assignees: kairu-ms
Labels:

customer-reported, Monitor, Service Attention, Auto Assign, Traiged

Milestone: Backlog

ghost avatar Mar 02 '22 07:03 ghost

Hi, The --output table here are different with the common table we think .As the output is an object , so CLI does not support this command to output in the form of table. Best wishes.

YuanyuanNi avatar Mar 04 '22 03:03 YuanyuanNi

I am facing the same issue. Is there any workaround to convert to CSV, at least?

mariomeyrelles avatar Jun 21 '23 23:06 mariomeyrelles