In our project, we want to use Azure Automation to start and stop Service Fabric Cluster nodes. At first, we use the:
Enable-ServiceFabricNode -NodeName "Node1"
Disable-ServiceFabricNode -NodeName "Node1"
To start and stop the Nodes, it works in my Windows Powershell Script, but when we add it to the Azure Automation Script, it show “The term ‘Enable-ServiceFabricNode’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name … ”
Then, we try to use the Azure Resources Manager to get the scale set VM, then start and stop the 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"
}
Also it works in my windows powershell script, but we try to add it to Azure Automation, it shows: “The term ‘Stop-AzureRmVmss’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name … ”
The Azure Automation is use the Azure Powershell Script, right?
So is there any way that we can use the Azure Automation Script to Start and Stop the Service Fabric Cluster nodes?
Thanks so much!