在没有 azure portal 的情况下启动 azure 虚拟机

Start azure virtual machine without azure portal

我想授权某人访问 Azure 上的虚拟机(使用 RDP 连接文件)并让他 start/stop VM 但不授予他访问 Azure 门户帐户的权限。

是否有无需访问门户即可在 Azure 上 start/stop 虚拟机的(简单)方法? "simple" 我的意思是您不需要 运行 一些行代码,这就像打开 RDP 文件一样简单。

或者,有没有办法不对运行宁(但闲置)虚拟机计费?

您可以使用 Powershell 脚本 start/stop 虚拟机。

不会,只要您签出已停止的 VM,您也需要为它们付费。

根据您的要求,我认为最好的方法是使用具有虚拟机贡献者角色的服务主体。它只是让用户管理虚拟机,但没有访问虚拟机的权限,也没有访问Azure门户的权限。

然后您可以使用此服务主体执行 Azure CLI、Azure PowerShell 命令或 REST API 到 start/stop Azure VM,它不会产生成本。

Is there a (simple) way to start/stop virtual machine on Azure without having to access the portal ? By "simple" I mean something that you don't need to run some line code and that can be as easy as opening a RDP file.

有可用的 SDK,您可以将其与 CLI 一起使用以编程方式访问 VM - 通过这种方式,您不需要访问门户。

Alternatively, is there a way not to be billed of running (but idle) virtual machine?

您需要为 idle 个 VM 付费,因为这仍然意味着该 VM 可以运行。为节省成本,终止 VM 并在需要时重新创建 VM。