【发布时间】:2017-01-05 06:21:25
【问题描述】:
在我们的项目中,我们希望使用 Azure 自动化来启动和停止 Service Fabric 群集节点。 首先,我们使用:
Enable-ServiceFabricNode -NodeName "Node1"
Disable-ServiceFabricNode -NodeName "Node1"
要启动和停止节点,它可以在我的 Windows Powershell 脚本中运行,但是当我们将它添加到 Azure 自动化脚本时,它会显示 “‘Enable-ServiceFabricNode’一词未被识别为 cmdlet、函数、脚本文件或可运行程序的名称。检查名字的拼写……”
然后,我们尝试使用 Azure 资源管理器获取规模集 VM,然后启动和停止 VM:
$Cred = Get-AutomationPSCredential -Name '***@***.com';
Add-AzureRmAccount -Credential $Cred
Set-AzureRmContext -TenantId ‘000000-786D-4361-A787-2C398163274F’
InlineScript
{
Stop-AzureRmVmss -ResourceGroupName "testRG" -VMScaleSetName "Test"
}
它也适用于我的 windows powershell 脚本,但我们尝试将它添加到 Azure 自动化,它显示: “‘Stop-AzureRmVmss’一词未被识别为 cmdlet、函数、脚本文件或可运行程序的名称。检查名字的拼写……”
Azure 自动化是使用 Azure Powershell 脚本,对吧?
那么我们有什么方法可以使用 Azure 自动化脚本来启动和停止 Service Fabric 群集节点?
非常感谢!
【问题讨论】:
-
你有没有得到答案?如何在 Azure 自动化中以静默方式对 SF 集群进行身份验证?
-
供参考:这个问题在微软论坛here也有提问和回答
标签: azure-service-fabric azure-powershell azure-automation