Timer switch implemented by a virtual machine on the Azure Automation

More details, please pay attention to public numbers:

 

Azure Automation can provide some automation functions, for example, we can specify whether the virtual machine at 6:00 every morning, 20 o'clock every day off the virtual machine.
It also provides some automated configuration-based monitoring parameters. The main contents of today is to introduce to achieve timing virtual machine startup and shutdown operations through Automation.

 Practical exercise video:

https://v.qq.com/x/page/r3023ijwt3e.html

Azure for different states of virtual machines billing situation:

 

workflow startVM
{
    $Cred = Get-AutomationPSCredential -Name "test-cred"; 
    Add-AzureRmAccount -Credential $Cred -EnvironmentName AzureChinaCloud;
    Select-AzureRmSubscription -SubscriptionId "xxxx-xxxx-xxxx";
    Start-AzureRmVM -ResourceGroupName "seanyutest" -Name "testvm"
}


workflow startVM
{
    $Cred = Get-AutomationPSCredential -Name "test-cred"; 
    Add-AzureRmAccount -Credential $Cred -EnvironmentName AzureChinaCloud;
    Select-AzureRmSubscription -SubscriptionId "xxxx-xxxx-xxxx";
    Stop-AzureRmVM -ResourceGroupName "seanyutest" -Name "testvm" -Force
}

  

Note that the parameters should be increased -Force shutdown, because the shutdown is executed in powershell, there will be interactive content, to be entered from the keyboard YES will perform shutdown operations, when we shut down by Automation execution, should be forced to shut down.

 

Runbook currently supports the following types:

 

 Azure automation can be managed throughout the life cycle of infrastructure and application. Transmission of knowledge about how organizations can deliver and maintain the workload to the system; you can achieve the following main elements:

Build / deploy resources - use Runbook and explorer Azure VM templates to deploy in mixed environments. Jenkins integrated into other development tools.

Configure VM - using the infrastructure and applications needed for configuration assessment and configure Windows and Linux computers.

Monitoring - identifying those changes cause problems on your computer and make the appropriate remedy, or upgrade it to management systems.

Protection - VM isolation in the case has triggered security alerts. Set within the requirements of the guests.

Control - to set role-based access control for the team. Recover unused resources.

 

Pricing:

 

Guess you like

Origin www.cnblogs.com/shuzhenyu/p/11904758.html