Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Azure Automation Automation-automatically shuts down Azure

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Azure Automation can provide some automation features, such as we can specify that the virtual machine is turned on at 6: 00 in the morning and turned off at 8: 00 in the evening.

At the same time, it also provides some automatic configuration based on monitoring parameters. Today's main content is to introduce the implementation of timing through Automation to power on and off the virtual machine.

Azure charges virtual machines in different states:

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 stopVM {$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 parameter-Force should be added when shutting down, because there will be interaction when performing shutdown in powershell, and you need to type YES from the keyboard to perform shutdown. When we perform shutdown through Automation, you should force shutdown.

Currently, there are several types of Runbook supported:

Azure automation can be managed throughout the lifecycle of infrastructure and applications. Knowledge about how an organization delivers and maintains workloads can be transferred to the system; the following can be achieved:

Generate / deploy resources-deploy VM in a mixed environment using Runbook and Azure Explorer templates. Integrated into development tools such as Jenkins.

Configure VM-evaluate and configure Windows and Linux computers using the required configurations for infrastructure and applications.

Monitor-identify the changes on the computer that are causing the problem, remedy them accordingly, or upgrade them to the management system.

Protection-isolate the VM if a security alert has been raised. Set intra-guest requirements.

Control-set up role-based access control for the team. Restore unused resources.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report