Giter Club home page Giter Club logo

stop-azure-vm-on-alert's Introduction

Stop-Azure-VM-On-Alert

  • This runbook will stop an ARM VM in response to an Azure alert trigger
  • Input is alert data with information needed to identify which VM to stop.
  • The runbook must be called from an Azure alert via a webhook
  • Latest version of Az module should be added to the automation account
  • Managed Identity should be enabled and contributor access to the automation account should be given

stop-azure-vm-on-alert's People

Contributors

krmanupa avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

stop-azure-vm-on-alert's Issues

Wrong value assigned to ResourceName

Hi,
I'm using this runbook to stop a VM when is running for more than X time. I have a log query alert to check the started time of the VM and the runbook configured to Stop the VM. When the alert fires the runbook is not stopping the VM.

When the webook calls the runbook I see that there is a wrong assingnement of the values on the variables.

This is what I see on the output logs:

schemaId: azureMonitorCommonAlertSchema
status: Fired
resourceType: /
resourceName: x-xxx-xxxx-xxx-xxxx-xxx (resourceGroupName) instead of VM name
resourceGroupName: x-xxx-xxxx-xxx-xxxx-xxx (resourceGroupName)
subscriptionId: yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyy

The resource name is getting the resource group name. I belive this is the cause for the runbook to fail?

How can I correct this issue? Should I add other alert schemaId?

Appreciate the help.

Thanks,

PF

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.