为什么?
我有一个安装了Visual Studio的Azure VM。当我从这里运行关闭脚本(Runbook)时:https://gallery.technet.microsoft.com/scriptcenter/Stop-Azure-Virtual-Machine-0b1fea97
脚本状态显示它已完成,但它没有关闭我的虚拟机。输出显示正在关闭,但什么也没有发生。
对此有什么建议吗?
谢谢你的帮助。彼得
发布于 2015-03-17 20:32:40
我建议你做几件事-
a.大多数imp-转到资产选项卡并添加适当的windows powershell凭据(您只需使用用户名和密码,就可以登录到azure门户)。
b.将代码添加到runbook中。假设您的powershell自动化凭据名称为StartVM,您的订阅名称为xxx。在这种情况下,工作流程将是-
workflow StartVM
{
$Cred = Get-AutomationPSCredential -Name
StartVM' Add-AzureAccount -Credential $Cred
Select-AzureSubscription -SubscriptionName “xxx”
inlineScript
{
Start-AzureVM -Name TestServer -ServiceName CS12345
}
}c.在此之后,您可以根据需要安排您的runbook。
希望这篇文章能帮助你-
http://azure.microsoft.com/blog/2014/11/25/introducing-the-azure-automation-script-converter/ http://azure.microsoft.com/en-us/documentation/articles/automation-create-runbook-from-samples/
谢谢。
https://stackoverflow.com/questions/29027625
复制相似问题