azure - 启动 Azure VM 指定时间

标签 azure powershell azure-powershell

我需要使用 powershell cmdlet 启动 Azure VM 一个小时。我尝试使用 Start-AzVM cmdlet,但没有设置时间的选项。

是否可以使用 az module cmdlet 设置 VM 时间?

该要求类似于 Azure 沙盒环境,在启动时经过一定时间后会自动销毁。

最佳答案

目前,没有可以在特定时间启动 VM 的命令。但是,还有其他方法可以实现您的要求。

方式 - 1

您可以从左 View Pane 导航到操作>>自动关闭,然后根据虚拟机运行的时间安排关闭。

enter image description here

enter image description here

方式 - 2

您可以通过导航到资源 >>​​ 自动化 >> 任务 >> 添加任务来自动关闭或启动虚拟机的任务。

enter image description here

现在您可以自动启动和关闭虚拟机。

enter image description here

或者,您可以使用逻辑应用来完成此工作 Azure VM连接器。

enter image description here

关于azure - 启动 Azure VM 指定时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74099974/

相关文章:

powershell - 添加-AzureRmAccount : Sequence contains no elements

ruby-on-rails - 无法使用 redis-rb gem 和公共(public)访问连接到集群 Azure Redis 缓存

arrays - 使用数组和脚本 block 安装多个应用程序的 Powershell 脚本

azure - 是否有一些如何在 Azure 无服务器解决方案的协商中动态指定 Azure SignalR 的集线器名称?

file - 如何更改文件列表的读取属性?

.net - 使用 SeriLog 和 PowerShell 实现 Hello World

azure - 在 Docker 容器中运行 Azure PowerShell 脚本

json - Arm 模板中的 copyindex() 错误

Azure Worker角色缩小位置

azure - 如何将 NPM 包推送到 Azure Artifact Feed?