Git Product home page Git Product logo

diecknet / simple-azure-vm-start-stop Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 9.0 43 KB

Simple PowerShell Script to Start or Stop an Azure Virtual Machine using Azure Automation with a Managed Identity. Uses the new ("Az") Azure PowerShell module.

License: MIT License

PowerShell 100.00%
azureautomationrunbookgallery azure-automation-runbooks azure-automation-runbook azure-virtual-machine azure-virtual-machines azure-managed-service-identity azure powershell azure-managed-identity

simple-azure-vm-start-stop's People

Contributors

diecknet avatar sanderblom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

simple-azure-vm-start-stop's Issues

Az and AzureRM conflict

Hi. When I try to use your runbook script - runbook test returned me following:

Script started at 2023-09-21 10:31:11
Both Az and AzureRM modules were detected on this machine. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide

I can't delete AzureRM modules from Automation Accounts Modules - "Delete" button not active.
What can I do? Help, plz!!!!

Invalid resource group 'XXXXXXXXX' does not result in Job Failure

Get-AzVM : Resource group 'XXXXXXXX' could not be found. ErrorCode: ResourceGroupNotFound ErrorMessage: Resource group 'XXXXXXXX' could not be found. ErrorTarget: StatusCode: 404 ReasonPhrase: Not Found OperationID : 91c0a45d-66f9-49f7-a464-ce7113a2bc61 At line:133 char:16 + ... $VMs = Get-AzVM -ResourceGroupName $ResourceGroupName -VMName $V ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [Get-AzVM], ComputeCloudException + FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.GetAzureVMCommand

The status of the Job gives Completed

By the way, Thanks for the script. I am very happy with it. Much better than the old graphic powershell scripts: StartAzureV2VMs/StopAzureV2VMs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.