Azure 运行-command returns t运行 输出

Azure run-command returns truncated output

我运行一个获取所有进程列表的简单命令:

az vm run-command invoke -g myGroup -n MyVm --command-id RunShellScript --scripts "ps"

我收到了回复,但似乎已经完全解决了运行(返回最后 X 个字符)。我没有找到任何关于它应该如何的文档,它是一个错误还是存在一些参数来修复它?

P.S。这是一个 linux vm

run-command 在 Azure VM 中执行脚本。请注意,使用 运行 命令时会出现 restrictions 列表。

  • Output is limited to the last 4096 bytes
  • The minimum time to run a script about 20 seconds
  • Scripts run by default as elevated user on Linux
  • One script at a time may run
  • Scripts that prompt for information (interactive mode) are not supported.
  • You cannot cancel a running script
  • The maximum time a script can run is 90 minutes, after which it will time out
  • Outbound connectivity from the VM is required to return the results of the script.

您还可以通过导航到您的 Azure VM 和 select 运行 命令 Operations[=24= 下检查输出].

希望对您有所帮助。