I would suggest you few things-
a. Most imp- Go to ASSET tab and add proper windows powershell credentials (simply you can use username and password, the same you use to login to azure portal).
b. Add your code in the runbook. Suppose your powershell automation credential name is StartVM and your subscription name is xxx. In this case the workflow will be-
workflow StartVM
{
$Cred = Get-AutomationPSCredential -Name
StartVM' Add-AzureAccount -Credential $Cred
Select-AzureSubscription -SubscriptionName “xxx”
inlineScript
{
Start-AzureVM -Name TestServer -ServiceName CS12345
}
}
c. After this you can schedule your runbook as per your need.
Hope this one will help you-
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/
Thanks.