使用时如何运行多行查询az monitor app-insights query
?
此单行查询按预期方式工作:
$query = "requests | summarize count() by bin(timestamp, 1h)"
az monitor app-insights query --app $appId --analytics-query $query --offset 1h30m
此多行查询导致错误:
$query = @"
requests |
summarize count() by bin(timestamp, 1h)
"@
az monitor app-insights query --app $appId --analytics-query $query --offset 1h30m
相关文档:https : //docs.microsoft.com/zh-cn/cli/azure/ext/application-insights/monitor/app-insights? view = azure-cli-latest#ext_application_insights_az_monitor_app_insights_query-examples
这可行,但是我宁愿使用here字符串:
$query =
"requests | " +
"summarize count() by bin(timestamp, 1h)"
az monitor app-insights query --app $appId --analytics-query $query --offset 1h30m
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句