I am considering about two cases. One is edit runbooks on Visual Studio, then execute them to perform Automation task directly. Another one is that edit runbooks on Visual Studio, then I use PowerShell to execute those runbooks. I'm not sure about these two options. Can anyone help me? Any help would be grateful. Thank You
Azure Automation runbooks are just PowerShell Workflows, which can be run locally on your machine as well. The only thing special about runbooks compared to PowerShell Workflows is in runbooks you can use the "Automation activities" (Get-AutomationVariable, Get-AutomationPSCredential, etc).
We don't have a blog post about this out for Azure Automation yet, but we do for Service Management Automation (the onpremise version of Azure Automation), which is very similar: http://blogs.technet.com/b/orchestrator/archive/2014/03/27/authoring-sma-runbooks-in-the-powershell-ise.aspx